Module: Xively::Base::InstanceMethods
- Defined in:
- lib/xively-rb/base/instance_methods.rb
Instance Method Summary collapse
-
#to_xively ⇒ Object
Converts a model that extends Xively::Base into it’s equivalent Xively object this can then be used to convert into xml, json or csv.
Instance Method Details
#to_xively ⇒ Object
Converts a model that extends Xively::Base into it’s equivalent Xively object
this can then be used to convert into xml, json or csv
7 8 9 10 11 12 13 |
# File 'lib/xively-rb/base/instance_methods.rb', line 7 def to_xively attributes = {} self.class.xively_class::ALLOWED_KEYS.each do |key| attributes[key] = self.send(key) if self.respond_to?(key) end self.class.xively_class.new(attributes.merge(custom_xively_attributes)) end |