Class: GrapeDSL::Extend::APIMNT::Description
- Inherits:
-
Object
- Object
- GrapeDSL::Extend::APIMNT::Description
- Defined in:
- lib/grape-dsl/dsl.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#content_type ⇒ Object
(also: #type)
Returns the value of attribute content_type.
-
#description ⇒ Object
(also: #desc)
Returns the value of attribute description.
Instance Method Summary collapse
- #[](sym) ⇒ Object
- #[]=(sym, value) ⇒ Object
-
#initialize(opts = {}) ⇒ Description
constructor
A new instance of Description.
- #value ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Description
Returns a new instance of Description.
9 10 11 12 |
# File 'lib/grape-dsl/dsl.rb', line 9 def initialize opts={} raise unless opts.class <= ::Hash opts.each{|k,v| self.__send__("#{k}=",v) } end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
22 23 24 |
# File 'lib/grape-dsl/dsl.rb', line 22 def body @body end |
#content_type ⇒ Object Also known as: type
Returns the value of attribute content_type.
22 23 24 |
# File 'lib/grape-dsl/dsl.rb', line 22 def content_type @content_type end |
#description ⇒ Object Also known as: desc
Returns the value of attribute description.
22 23 24 |
# File 'lib/grape-dsl/dsl.rb', line 22 def description @description end |
Instance Method Details
#[](sym) ⇒ Object
14 15 16 |
# File 'lib/grape-dsl/dsl.rb', line 14 def [] sym self.__send__ sym.to_s end |
#[]=(sym, value) ⇒ Object
18 19 20 |
# File 'lib/grape-dsl/dsl.rb', line 18 def []= sym,value self.__send__ "#{sym.to_s}=",value end |
#value ⇒ Object
28 29 30 |
# File 'lib/grape-dsl/dsl.rb', line 28 def value {description: description,content_type: content_type,body: body} end |