Class: ApiModel::Base
- Inherits:
-
Hashie::Trash
- Object
- Hashie::Trash
- ApiModel::Base
- Extended by:
- ActiveModel::Callbacks, ActiveModel::Naming, RestMethods
- Includes:
- ActiveModel::Conversion, ActiveModel::Serialization, ActiveModel::Validations, ConfigurationMethods
- Defined in:
- lib/api-model.rb
Instance Method Summary collapse
-
#property_exists?(property_name) ⇒ Boolean
Overrides Hashie::Trash to catch errors from trying to set properties which have not been defined and defines it automatically.
Methods included from RestMethods
Instance Method Details
#property_exists?(property_name) ⇒ Boolean
Overrides Hashie::Trash to catch errors from trying to set properties which have not been defined and defines it automatically
41 42 43 44 45 46 |
# File 'lib/api-model.rb', line 41 def property_exists?(property_name) super property_name rescue NoMethodError Log.debug "Could not set #{property_name} on #{self.class.name}. Defining it now." self.class.property property_name.to_sym end |