Last active
December 31, 2015 13:09
-
-
Save yinquanteo/7991320 to your computer and use it in GitHub Desktop.
ActiveSupport::StringInquirer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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