Sha256: 4aa91c9abb4bdc78ad35d1b625cb1ad73ec6f99ef6a11280050777a401ef3d37

Contents?: true

Size: 880 Bytes

Versions: 1

Compression:

Stored size: 880 Bytes

Contents

require 'forwardable'
require 'active_support/all'

module JsonApiClient
  class Resource
    attr_accessor :result_set
    class_attribute :site, :primary_key
    self.primary_key = :id

    class << self
      # base URL for this resource
      def resource
        File.join(site, path)
      end

      def table_name
        resource_name.pluralize
      end

      def resource_name
        name.demodulize.underscore
      end
    end

    include Helpers::Initializable
    include Helpers::Attributable
    include Helpers::Associable
    include Helpers::Parsable
    include Helpers::Queryable
    include Helpers::Serializable
    include Helpers::Linkable
    include Helpers::Relatable
    include Helpers::CustomEndpoints
    include Helpers::Schemable
    include Helpers::Paginatable
    include Helpers::Requestable
    include Helpers::CustomHeaders

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
json_api_client-1.0.0.beta5 lib/json_api_client/resource.rb