Class: Volute::Target

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, attribute, previous_value, value) ⇒ Target

Returns a new instance of Target.



171
172
173
174
175
176
177
178
179
# File 'lib/volute.rb', line 171

def initialize(object, attribute, previous_value, value)

  @object = object
  @attribute = attribute
  @previous_value = previous_value
  @value = value

  @over = false
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



169
170
171
# File 'lib/volute.rb', line 169

def attribute
  @attribute
end

#objectObject (readonly)

Returns the value of attribute object.



169
170
171
# File 'lib/volute.rb', line 169

def object
  @object
end

#previous_valueObject (readonly)

Returns the value of attribute previous_value.



169
170
171
# File 'lib/volute.rb', line 169

def previous_value
  @previous_value
end

#valueObject (readonly)

Returns the value of attribute value.



169
170
171
# File 'lib/volute.rb', line 169

def value
  @value
end

Instance Method Details

#overObject



191
192
193
194
# File 'lib/volute.rb', line 191

def over

  @over = true
end

#volute(*args, &block) ⇒ Object



181
182
183
184
185
186
187
188
189
# File 'lib/volute.rb', line 181

def volute(*args, &block)

  return if @over

  match = (args.first == :not) ? ( ! match?(args[1..-1])) : match?(args)
  return unless match

  self.instance_eval(&block)
end