Class: SimpleParams::ApiPieDoc::Attribute

Inherits:
AttributeBase show all
Defined in:
lib/simple_params/api_pie_doc/attribute.rb

Instance Attribute Summary

Attributes inherited from AttributeBase

#attribute, #options

Instance Method Summary collapse

Constructor Details

#initialize(simple_params_attribute) ⇒ Attribute

Returns a new instance of Attribute.



4
5
6
7
# File 'lib/simple_params/api_pie_doc/attribute.rb', line 4

def initialize(simple_params_attribute)
  super
  self.options ||= attribute[1]
end

Instance Method Details

#nameObject



9
10
11
# File 'lib/simple_params/api_pie_doc/attribute.rb', line 9

def name
  attribute[0].to_s
end

#to_sObject



13
14
15
16
# File 'lib/simple_params/api_pie_doc/attribute.rb', line 13

def to_s
  return nil if do_not_document?
  attribute_description
end