Class: ActiveRemote::Base

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Callbacks
Includes:
ActiveAttr::Model, ActiveModel::Validations::Callbacks, Association, Attributes, Bulk, DSL, Dirty, Integration, Persistence, PrimaryKey, Publication, RPC, ScopeKeys, Search, Serialization, Validations
Defined in:
lib/active_remote/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validations

#save, #save!, #valid?

Methods included from Dirty

#disable_dirty_tracking, #enable_dirty_tracking, #reload, #save, #save!, #skip_dirty_tracking, #write_attribute

Methods included from Serialization

#add_errors, #add_errors_from_response, #serialize_records

Methods included from Search

#_active_remote_search, #reload

Methods included from ScopeKeys

#scope_key_hash, #scope_keys

Methods included from RPC

#rpc

Methods included from Publication

#_publishable_json_attributes, #_publishable_json_methods, #publishable_hash

Methods included from PrimaryKey

#primary_key

Methods included from Persistence

#delete, #delete!, #destroy, #destroy!, #has_errors?, #instantiate, #new_record?, #persisted?, #readonly!, #readonly?, #save, #save!, #success?, #update_attribute, #update_attributes, #update_attributes!

Methods included from Integration

#cache_key, #to_param

Methods included from Attributes

#read_attribute, #write_attribute

Constructor Details

#initializeBase

Returns a new instance of Base.



51
52
53
54
55
56
57
58
59
60
# File 'lib/active_remote/base.rb', line 51

def initialize(*)
  @attributes ||= {}
  @new_record = true

  skip_dirty_tracking do
    run_callbacks :initialize do
      super
    end
  end
end

Instance Attribute Details

#last_requestObject (readonly)

Returns the value of attribute last_request.



47
48
49
# File 'lib/active_remote/base.rb', line 47

def last_request
  @last_request
end

#last_responseObject (readonly)

Returns the value of attribute last_response.



47
48
49
# File 'lib/active_remote/base.rb', line 47

def last_response
  @last_response
end

Instance Method Details

#freezeObject



62
63
64
# File 'lib/active_remote/base.rb', line 62

def freeze
  @attributes.freeze; self
end

#frozen?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/active_remote/base.rb', line 66

def frozen?
  @attributes.frozen?
end