Sha256: fac3d492cd0e835c2ce64c128271f70fa6877f3d98cec223017d4e8f01e80593

Contents?: true

Size: 845 Bytes

Versions: 3

Compression:

Stored size: 845 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

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
json_api_client-1.0.0.beta4 lib/json_api_client/resource.rb
json_api_client-1.0.0.beta3 lib/json_api_client/resource.rb
json_api_client-1.0.0.beta2 lib/json_api_client/resource.rb