Class: Raddocs::ResponseField
- Inherits:
-
Object
- Object
- Raddocs::ResponseField
- Defined in:
- lib/raddocs/models.rb
Overview
Fields of a response
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.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Allows unknown keys to be accessed.
-
#initialize(attributes) ⇒ ResponseField
constructor
A new instance of ResponseField.
-
#scope? ⇒ Boolean
True if scope is present.
Constructor Details
#initialize(attributes) ⇒ ResponseField
Returns a new instance of ResponseField.
207 208 209 210 211 212 213 |
# File 'lib/raddocs/models.rb', line 207 def initialize(attributes) @attrs = attributes @name = attributes.fetch("name") @description = attributes.fetch("description") @scope = attributes.fetch("scope", nil) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
205 206 207 |
# File 'lib/raddocs/models.rb', line 205 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
205 206 207 |
# File 'lib/raddocs/models.rb', line 205 def name @name end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
205 206 207 |
# File 'lib/raddocs/models.rb', line 205 def scope @scope end |
Instance Method Details
#[](key) ⇒ Object
Allows unknown keys to be accessed
223 224 225 |
# File 'lib/raddocs/models.rb', line 223 def [](key) @attrs[key] end |
#scope? ⇒ Boolean
Returns true if scope is present.
216 217 218 |
# File 'lib/raddocs/models.rb', line 216 def scope? !!@scope end |