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.
128 129 130 131 132 133 134 135 |
# File 'lib/raddocs/models.rb', line 128 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.
121 122 123 |
# File 'lib/raddocs/models.rb', line 121 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
121 122 123 |
# File 'lib/raddocs/models.rb', line 121 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
121 122 123 |
# File 'lib/raddocs/models.rb', line 121 def required @required end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
121 122 123 |
# File 'lib/raddocs/models.rb', line 121 def scope @scope end |
Instance Method Details
#[](key) ⇒ Object
Allows unknown keys to be accessed
160 161 162 |
# File 'lib/raddocs/models.rb', line 160 def [](key) @attrs[key] end |
#required? ⇒ Boolean
Returns true if required is true.
138 139 140 |
# File 'lib/raddocs/models.rb', line 138 def required? !!@required end |
#scope? ⇒ Boolean
Returns true if scope is present.
143 144 145 |
# File 'lib/raddocs/models.rb', line 143 def scope? !!@scope end |