Sha256: c0cbce3ad7a19083b4fea766ad62997bd5a0c340eef28f4b6eb4f78c1e985493
Contents?: true
Size: 623 Bytes
Versions: 14
Compression:
Stored size: 623 Bytes
Contents
module JSONAPIonify::Api module Resource::Definitions::ResponseHeaders def self.extended(klass) klass.class_eval do extend JSONAPIonify::InheritedAttributes inherited_hash_attribute :response_header_definitions context(:response_headers, persisted: true) do |context| self.class.response_header_definitions.each_with_object({}) do |(name, block), headers| headers[name.to_s] = instance_exec(context, &block) end end end end def response_header(name, &block) self.response_header_definitions[name] = block end end end
Version data entries
14 entries across 14 versions & 1 rubygems