Skip to content

Instantly share code, notes, and snippets.

@yinquanteo
Last active December 31, 2015 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yinquanteo/7991320 to your computer and use it in GitHub Desktop.
Save yinquanteo/7991320 to your computer and use it in GitHub Desktop.
ActiveSupport::StringInquirer
require 'active_support'
module Yink
def self.feeling
ActiveSupport::StringInquirer.new(@emotion || "")
end
def self.feeling= emotion
@emotion = emotion
end
end
Yink.feeling = "happy"
Yink.feeling.bored? # => false
Yink.feeling.happy? # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment