Sha256: 594b44615ff0941d3136c61f413518c236b1af495d517191a77798261f836578

Contents?: true

Size: 450 Bytes

Versions: 31

Compression:

Stored size: 450 Bytes

Contents

module JsonApiClient
  module Associations
    class BaseAssociation
      attr_reader :attr_name, :klass, :options
      def initialize(attr_name, klass, options = {})
        @attr_name = attr_name
        @klass = klass
        @options = options
      end

      def association_class
        @association_class ||= Utils.compute_type(klass, options.fetch(:class_name) do
          attr_name.to_s.classify
        end)
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
json_api_client-0.3.1 lib/json_api_client/associations/base_association.rb
json_api_client-0.3.0 lib/json_api_client/associations/base_association.rb
json_api_client-0.2.4 lib/json_api_client/associations/base_association.rb
json_api_client-0.2.3 lib/json_api_client/associations/base_association.rb
json_api_client-0.2.2 lib/json_api_client/associations/base_association.rb
json_api_client-0.2.1 lib/json_api_client/associations/base_association.rb
json_api_client-0.2.0 lib/json_api_client/associations/base_association.rb
json_api_client-0.1.3 lib/json_api_client/associations/base_association.rb
json_api_client-0.1.2 lib/json_api_client/associations/base_association.rb
json_api_client-0.1.1 lib/json_api_client/associations/base_association.rb
json_api_client-0.0.3 lib/json_api_client/associations/base_association.rb