Module: Otis::Object
- Included in:
- Model
- Defined in:
- lib/otis/otis_object.rb
Defined Under Namespace
Modules: ClassExtension
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/otis/otis_object.rb', line 4 def self.included(base) base.extend(ClassExtension) end |
Instance Method Details
#initialize(attributes = {}) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/otis/otis_object.rb', line 8 def initialize(attributes = {}) raise UnexpectedContentError.new("Array received when a hash was expected by class #{self.class}: \n#{@response}") if attributes.is_a?(Array) @response = attributes @response.each_pair do |k, v| m = underscore(k.to_s) self.send("#{m}=", v ) if self.respond_to?("#{m}=") end end |