Class: Emoruby::EmojiScript
- Inherits:
-
Object
- Object
- Emoruby::EmojiScript
- Defined in:
- lib/emoruby/emoji_script.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #eval ⇒ Object
-
#initialize(source) ⇒ EmojiScript
constructor
A new instance of EmojiScript.
- #to_ruby ⇒ Object
Constructor Details
#initialize(source) ⇒ EmojiScript
Returns a new instance of EmojiScript.
7 8 9 |
# File 'lib/emoruby/emoji_script.rb', line 7 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'lib/emoruby/emoji_script.rb', line 5 def source @source end |
Instance Method Details
#eval ⇒ Object
15 16 17 |
# File 'lib/emoruby/emoji_script.rb', line 15 def eval eval(to_ruby) end |
#to_ruby ⇒ Object
11 12 13 |
# File 'lib/emoruby/emoji_script.rb', line 11 def to_ruby @ruby ||= ConvertsEmojiToRuby.new(@source).call end |