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.
183 184 185 186 187 188 189 |
# File 'lib/raddocs/models.rb', line 183 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.
181 182 183 |
# File 'lib/raddocs/models.rb', line 181 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
181 182 183 |
# File 'lib/raddocs/models.rb', line 181 def name @name end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
181 182 183 |
# File 'lib/raddocs/models.rb', line 181 def scope @scope end |
Instance Method Details
#[](key) ⇒ Object
Allows unknown keys to be accessed
199 200 201 |
# File 'lib/raddocs/models.rb', line 199 def [](key) @attrs[key] end |
#scope? ⇒ Boolean
Returns true if scope is present.
192 193 194 |
# File 'lib/raddocs/models.rb', line 192 def scope? !!@scope end |