Class: DocSmoosher::ApiObject
- Inherits:
-
Object
- Object
- DocSmoosher::ApiObject
- Includes:
- Parameters
- Defined in:
- lib/doc_smoosher/api_object.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#description ⇒ Object
Returns the value of attribute description.
-
#example ⇒ Object
Returns the value of attribute example.
-
#name ⇒ Object
Returns the value of attribute name.
-
#required ⇒ Object
Returns the value of attribute required.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes included from Parameters
Instance Method Summary collapse
-
#initialize(params = {}, &block) ⇒ ApiObject
constructor
A new instance of ApiObject.
Methods included from Parameters
Constructor Details
#initialize(params = {}, &block) ⇒ ApiObject
Returns a new instance of ApiObject.
7 8 9 10 11 12 13 |
# File 'lib/doc_smoosher/api_object.rb', line 7 def initialize(params = {}, &block) instance_eval(&block) params.each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
3 4 5 |
# File 'lib/doc_smoosher/api_object.rb', line 3 def default @default end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/doc_smoosher/api_object.rb', line 3 def description @description end |
#example ⇒ Object
Returns the value of attribute example.
3 4 5 |
# File 'lib/doc_smoosher/api_object.rb', line 3 def example @example end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/doc_smoosher/api_object.rb', line 3 def name @name end |
#required ⇒ Object
Returns the value of attribute required.
3 4 5 |
# File 'lib/doc_smoosher/api_object.rb', line 3 def required @required end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/doc_smoosher/api_object.rb', line 3 def type @type end |