Class: Jass::Function
- Inherits:
-
Object
- Object
- Jass::Function
- Defined in:
- lib/jass/function.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, code) ⇒ Function
constructor
A new instance of Function.
- #to_js ⇒ Object
Constructor Details
#initialize(name, code) ⇒ Function
Returns a new instance of Function.
5 6 7 |
# File 'lib/jass/function.rb', line 5 def initialize(name, code) @name, @code = name, code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/jass/function.rb', line 3 def code @code end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/jass/function.rb', line 3 def name @name end |
Instance Method Details
#to_js ⇒ Object
9 10 11 |
# File 'lib/jass/function.rb', line 9 def to_js "__methods__[#{name.to_json}] = (#{code});\n" end |