Class: Raddocs::Parameter
- Inherits:
-
Object
- Object
- Raddocs::Parameter
- Defined in:
- lib/raddocs/models.rb
Overview
Parameter of a request
Can have an unknown columns
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Allows unknown keys to be accessed.
-
#initialize(attributes) ⇒ Parameter
constructor
A new instance of Parameter.
-
#required? ⇒ Boolean
True if required is true.
-
#scope? ⇒ Boolean
True if scope is present.
Constructor Details
#initialize(attributes) ⇒ Parameter
Returns a new instance of Parameter.
113 114 115 116 117 118 119 120 |
# File 'lib/raddocs/models.rb', line 113 def initialize(attributes) @attrs = attributes @name = attributes.fetch("name") @description = attributes.fetch("description") @required = attributes.fetch("required", false) @scope = attributes.fetch("scope", nil) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
106 107 108 |
# File 'lib/raddocs/models.rb', line 106 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
106 107 108 |
# File 'lib/raddocs/models.rb', line 106 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
106 107 108 |
# File 'lib/raddocs/models.rb', line 106 def required @required end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
106 107 108 |
# File 'lib/raddocs/models.rb', line 106 def scope @scope end |
Instance Method Details
#[](key) ⇒ Object
Allows unknown keys to be accessed
145 146 147 |
# File 'lib/raddocs/models.rb', line 145 def [](key) @attrs[key] end |
#required? ⇒ Boolean
Returns true if required is true.
123 124 125 |
# File 'lib/raddocs/models.rb', line 123 def required? !!@required end |
#scope? ⇒ Boolean
Returns true if scope is present.
128 129 130 |
# File 'lib/raddocs/models.rb', line 128 def scope? !!@scope end |