Method: Chawk::Models::Node#increment

Defined in:
lib/node.rb

#increment(value = 1, options = {}) ⇒ Object



184
185
186
187
188
189
190
191
192
# File 'lib/node.rb', line 184

def increment(value=1, options={})
  check_write_access
  if value.is_a?(Integer)
    last = self.points.last
    add_points last.value + value,options 
  else 
    raise ArgumentError, "Value must be an Integer"
  end
end