Module: JSONAPI::Serializable::Resource::Type::DSL
- Defined in:
- lib/jsonapi/serializable/resource/type.rb
Overview
DSL methods for declaring the resource type.
Instance Method Summary collapse
Instance Method Details
#inherited(klass) ⇒ Object
34 35 36 37 38 |
# File 'lib/jsonapi/serializable/resource/type.rb', line 34 def inherited(klass) super klass.type_val = type_val klass.type_block = type_block end |
#type(value) ⇒ Object #type(&block) ⇒ Object
54 55 56 57 |
# File 'lib/jsonapi/serializable/resource/type.rb', line 54 def type(value = nil, &block) self.type_val = value.to_sym if value self.type_block = block end |