Class: Flexirest::Base

Inherits:
BaseWithoutValidation show all
Includes:
Validation
Defined in:
lib/flexirest/base.rb

Instance Attribute Summary

Attributes inherited from BaseWithoutValidation

#_etag, #_headers, #_status

Instance Method Summary collapse

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, #changed, #changed?, #changes, #dirty?, #each, #inspect, #method_missing, prepare_direct_request, #respond_to_missing?, #to_hash, #to_json

Methods included from Associations

included

Methods included from Recording

included

Methods included from Caching

included

Methods included from Callbacks

included

Methods included from Configuration

included

Methods included from Mapping

included

Constructor Details

#initialize(attrs = {}) ⇒ Base

Returns a new instance of Base.

Raises:

  • (Exception)


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

#errorsObject



10
11
12
# File 'lib/flexirest/base.rb', line 10

def errors
  @attributes[:errors] || (_errors != {} ? _errors : nil)
end