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.
137 138 139 140 141 142 143 144 |
# File 'lib/raddocs/models.rb', line 137 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.
130 131 132 |
# File 'lib/raddocs/models.rb', line 130 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
130 131 132 |
# File 'lib/raddocs/models.rb', line 130 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
130 131 132 |
# File 'lib/raddocs/models.rb', line 130 def required @required end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
130 131 132 |
# File 'lib/raddocs/models.rb', line 130 def scope @scope end |
Instance Method Details
#[](key) ⇒ Object
Allows unknown keys to be accessed
169 170 171 |
# File 'lib/raddocs/models.rb', line 169 def [](key) @attrs[key] end |
#required? ⇒ Boolean
Returns true if required is true.
147 148 149 |
# File 'lib/raddocs/models.rb', line 147 def required? !!@required end |
#scope? ⇒ Boolean
Returns true if scope is present.
152 153 154 |
# File 'lib/raddocs/models.rb', line 152 def scope? !!@scope end |