Class: Jass::Plugin
- Inherits:
-
Object
- Object
- Jass::Plugin
- Defined in:
- lib/jass/plugin.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(name, arguments = nil, root = nil) ⇒ Plugin
constructor
A new instance of Plugin.
- #to_js ⇒ Object
Constructor Details
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
3 4 5 |
# File 'lib/jass/plugin.rb', line 3 def arguments @arguments end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/jass/plugin.rb', line 3 def name @name end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
3 4 5 |
# File 'lib/jass/plugin.rb', line 3 def root @root end |
Instance Method Details
#to_js ⇒ Object
9 10 11 12 |
# File 'lib/jass/plugin.rb', line 9 def to_js args = arguments.respond_to?(:call) ? arguments.call : arguments "__plugins__.push(#{name}(#{args}));\n" end |