Sha256: 1e95f1d3888a2740937832e330e92b79e44c4dc388605b2364250e077c8ea888

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 KB

Contents

require 'active_remote/association'
require 'active_remote/attributes'
require 'active_remote/bulk'
require 'active_remote/dirty'
require 'active_remote/dsl'
require 'active_remote/persistence'
require 'active_remote/rpc'
require 'active_remote/search'
require 'active_remote/serialization'

module ActiveRemote
  class Base
    extend ::ActiveModel::Callbacks

    include ::ActiveAttr::Model

    include ::ActiveRemote::Association
    include ::ActiveRemote::Attributes
    include ::ActiveRemote::Bulk
    include ::ActiveRemote::DSL
    include ::ActiveRemote::Persistence
    include ::ActiveRemote::RPC
    include ::ActiveRemote::Search
    include ::ActiveRemote::Serialization

    # Overrides some methods, providing support for dirty tracking,
    # so it needs to be included last.
    include ::ActiveRemote::Dirty

    attr_reader :last_request, :last_response

    define_model_callbacks :initialize, :only => :after

    def initialize(*)
      run_callbacks :initialize do
        @attributes ||= {}
        super
      end
    end

    def freeze
      @attributes.freeze; self
    end

    def frozen?
      @attributes.frozen?
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_remote-1.4.1 lib/active_remote/base.rb
active_remote-1.4.0 lib/active_remote/base.rb
active_remote-1.3.3 lib/active_remote/base.rb
active_remote-1.3.2 lib/active_remote/base.rb
active_remote-1.3.1 lib/active_remote/base.rb
active_remote-1.3.0 lib/active_remote/base.rb
active_remote-1.2.1 lib/active_remote/base.rb