Sha256: 6b0e78944a1133f5c89149182d45b907777e136511f49ef5001b96d6df1dce2d

Contents?: true

Size: 464 Bytes

Versions: 17

Compression:

Stored size: 464 Bytes

Contents

module JSONAPIonify::Api
  module Resource::Definitions::Contexts

    def self.extended(klass)
      klass.class_eval do
        extend JSONAPIonify::InheritedAttributes
        inherited_hash_attribute :context_definitions
      end
    end

    def context(name, **opts, &block)
      self.context_definitions[name.to_sym] = Context.new(
        **opts,
        existing_context: self.context_definitions[name.to_sym],
        &block
      )
    end

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
jsonapionify-0.12.2 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.12.1 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.12.0 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.11.11 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.11.10 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.11.9 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.11.8 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.11.7 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.11.6 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.11.5 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.11.0 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.10.2 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.10.1 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.10.0 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.9.3 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.9.2 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.9.1 lib/jsonapionify/api/resource/definitions/contexts.rb