Class: Strut::CallCommand
- Inherits:
-
SlimCommand
- Object
- SlimCommand
- Strut::CallCommand
- Defined in:
- lib/strut/slim_command.rb
Instance Attribute Summary collapse
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#property ⇒ Object
readonly
Returns the value of attribute property.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from SlimCommand
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(id, metadata, instance, property, value) ⇒ CallCommand
constructor
A new instance of CallCommand.
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id, metadata, instance, property, value) ⇒ CallCommand
Returns a new instance of CallCommand.
68 69 70 71 72 73 |
# File 'lib/strut/slim_command.rb', line 68 def initialize(id, , instance, property, value) super(id, ) @instance = instance @property = property @value = value end |
Instance Attribute Details
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
66 67 68 |
# File 'lib/strut/slim_command.rb', line 66 def instance @instance end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
66 67 68 |
# File 'lib/strut/slim_command.rb', line 66 def property @property end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
66 67 68 |
# File 'lib/strut/slim_command.rb', line 66 def value @value end |
Instance Method Details
#command ⇒ Object
75 76 77 |
# File 'lib/strut/slim_command.rb', line 75 def command "call" end |
#to_a ⇒ Object
79 80 81 82 83 |
# File 'lib/strut/slim_command.rb', line 79 def to_a ary = super + [@instance, @property] ary << @value unless @value.nil? ary end |
#to_s ⇒ Object
85 86 87 |
# File 'lib/strut/slim_command.rb', line 85 def to_s "#{super} #{@instance}.#{@property}(#{@value})" end |