Sha256: 4c50136ae457427aee6b172eafb9066d940114a9f90cf2ae11e5a6759b4f4d6a

Contents?: true

Size: 385 Bytes

Versions: 2

Compression:

Stored size: 385 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, readonly: false, &block)
      self.context_definitions[name.to_sym] = Context.new(block, readonly)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jsonapionify-0.9.0 lib/jsonapionify/api/resource/definitions/contexts.rb
jsonapionify-0.0.1.pre lib/jsonapionify/api/resource/definitions/contexts.rb