Class: Flexirest::Base
- Inherits:
-
BaseWithoutValidation
- Object
- BaseWithoutValidation
- Flexirest::Base
- Includes:
- Validation
- Defined in:
- lib/flexirest/base.rb
Instance Attribute Summary
Attributes inherited from BaseWithoutValidation
#_etag, #_headers, #_parent, #_parent_attribute_name, #_status
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(attrs = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Validation
#_errors, #full_error_messages, included, #valid?
Methods inherited from BaseWithoutValidation
#[], #[]=, #_attributes, #_clean!, #_copy_from, _lazy_request, _plain_request, _request, _request_for, #_set_dirty, #changed, #changed?, #changes, #dirty?, #each, #inspect, #method_missing, prepare_direct_request, #respond_to_missing?, #to_hash, #to_json
Methods included from Associations
Methods included from Recording
Methods included from Caching
Methods included from Callbacks
Methods included from Configuration
Methods included from Mapping
Constructor Details
#initialize(attrs = {}) ⇒ Base
Returns a new instance of Base.
5 6 7 8 |
# File 'lib/flexirest/base.rb', line 5 def initialize(attrs={}) raise Exception.new("Cannot instantiate Base class") if self.class == Flexirest::Base super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Flexirest::BaseWithoutValidation
Instance Method Details
#errors ⇒ Object
10 11 12 |
# File 'lib/flexirest/base.rb', line 10 def errors @attributes[:errors] || (_errors != {} ? _errors : nil) end |