module Locomotive::Steam::Models::Entity
Attributes
associations[RW]
attributes[RW]
base_url[RW]
localized_attributes[RW]
Public Class Methods
new(attributes)
click to toggle source
# File lib/locomotive/steam/models/entity.rb, line 10 def initialize(attributes) @attributes = attributes.with_indifferent_access end
Public Instance Methods
[](name)
click to toggle source
# File lib/locomotive/steam/models/entity.rb, line 37 def [](name) attributes[name] end
[]=(name, value)
click to toggle source
# File lib/locomotive/steam/models/entity.rb, line 33 def []=(name, value) attributes[name] = value end
_id()
click to toggle source
# File lib/locomotive/steam/models/entity.rb, line 29 def _id self['_id'] end
change(new_attributes)
click to toggle source
# File lib/locomotive/steam/models/entity.rb, line 41 def change(new_attributes) attributes.merge!((new_attributes || {}).with_indifferent_access) self end
method_missing(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/locomotive/steam/models/entity.rb, line 14 def method_missing(name, *args, &block) _name = name.to_s if attributes.include?(_name) self[_name] elsif _name.end_with?('=') && attributes.include?(_name.chop) self[_name.chop] = args.first else super end end
respond_to?(name, include_private = false)
click to toggle source
Calls superclass method
# File lib/locomotive/steam/models/entity.rb, line 25 def respond_to?(name, include_private = false) attributes.include?(name.to_s) || super end
serialize()
click to toggle source
# File lib/locomotive/steam/models/entity.rb, line 46 def serialize attributes.dup end