Class: GrapeDSL::Extend::APIMNT::Description

Inherits:
Object
  • Object
show all
Defined in:
lib/grape-dsl/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject

Returns the value of attribute body.



22
23
24
# File 'lib/grape-dsl/dsl.rb', line 22

def body
  @body
end

#content_typeObject 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

#descriptionObject 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

#valueObject



28
29
30
# File 'lib/grape-dsl/dsl.rb', line 28

def value
  {description: description,content_type: content_type,body: body}
end