Class: Useless::Doc::DSL::Body

Inherits:
Object
  • Object
show all
Includes:
Member
Defined in:
lib/useless/doc/dsl.rb

Instance Method Summary collapse

Methods included from Member

#generate, included, #initialize

Instance Method Details

#attribute(key, description, attributes = {}) ⇒ Object



201
202
203
204
# File 'lib/useless/doc/dsl.rb', line 201

def attribute(key, description, attributes = {})
  attribute = Doc::Body::Attribute.new attributes.merge(key: key, description: description)
  @attributes[:attributes] << attribute
end

#content_type(value) ⇒ Object



197
198
199
# File 'lib/useless/doc/dsl.rb', line 197

def content_type(value)
  @attributes[:content_type] = value
end

#default_attributesObject



193
194
195
# File 'lib/useless/doc/dsl.rb', line 193

def default_attributes
  { attributes: [] }
end