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



312
313
314
315
# File 'lib/useless/doc/dsl.rb', line 312

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

#content_type(value) ⇒ Object



308
309
310
# File 'lib/useless/doc/dsl.rb', line 308

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

#default_attributesObject



304
305
306
# File 'lib/useless/doc/dsl.rb', line 304

def default_attributes
  { attributes: [] }
end