Class: Emoruby::EmojiScript

Inherits:
Object
  • Object
show all
Defined in:
lib/emoruby/emoji_script.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sourceObject (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

#evalObject



15
16
17
# File 'lib/emoruby/emoji_script.rb', line 15

def eval
  eval(to_ruby)
end

#to_rubyObject



11
12
13
# File 'lib/emoruby/emoji_script.rb', line 11

def to_ruby
  @ruby ||= ConvertsEmojiToRuby.new(@source).call
end