Class: Strut::CallCommand

Inherits:
SlimCommand show all
Defined in:
lib/strut/slim_command.rb

Instance Attribute Summary collapse

Attributes inherited from SlimCommand

#id, #metadata

Instance Method Summary collapse

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

#instanceObject (readonly)

Returns the value of attribute instance.



66
67
68
# File 'lib/strut/slim_command.rb', line 66

def instance
  @instance
end

#propertyObject (readonly)

Returns the value of attribute property.



66
67
68
# File 'lib/strut/slim_command.rb', line 66

def property
  @property
end

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

#commandObject



75
76
77
# File 'lib/strut/slim_command.rb', line 75

def command
  "call"
end

#to_aObject



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_sObject



85
86
87
# File 'lib/strut/slim_command.rb', line 85

def to_s
  "#{super} #{@instance}.#{@property}(#{@value})"
end