Class: RspecApiDocs::Resource::ResponseField
- Inherits:
-
Object
- Object
- RspecApiDocs::Resource::ResponseField
- Defined in:
- lib/rspec_api_docs/formatter/resource/response_field.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ true, false
-
#description ⇒ String
The description of the response field.
-
#example ⇒ Object
Example value.
-
#initialize(name, field) ⇒ ResponseField
constructor
A new instance of ResponseField.
-
#scope ⇒ Array<String>
The scope of the response field.
-
#type ⇒ String
The type of the response field.
Constructor Details
#initialize(name, field) ⇒ ResponseField
Returns a new instance of ResponseField.
6 7 8 9 |
# File 'lib/rspec_api_docs/formatter/resource/response_field.rb', line 6 def initialize(name, field) @name = name @field = field end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
4 5 6 |
# File 'lib/rspec_api_docs/formatter/resource/response_field.rb', line 4 def field @field end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/rspec_api_docs/formatter/resource/response_field.rb', line 4 def name @name end |
Instance Method Details
#==(other) ⇒ true, false
38 39 40 41 |
# File 'lib/rspec_api_docs/formatter/resource/response_field.rb', line 38 def ==(other) name == other.name && field == other.field end |
#description ⇒ String
The description of the response field
28 29 30 |
# File 'lib/rspec_api_docs/formatter/resource/response_field.rb', line 28 def description field[:description] end |
#example ⇒ Object
Example value
33 34 35 |
# File 'lib/rspec_api_docs/formatter/resource/response_field.rb', line 33 def example field[:example] end |
#scope ⇒ Array<String>
The scope of the response field
14 15 16 |
# File 'lib/rspec_api_docs/formatter/resource/response_field.rb', line 14 def scope field[:scope] end |
#type ⇒ String
The type of the response field
21 22 23 |
# File 'lib/rspec_api_docs/formatter/resource/response_field.rb', line 21 def type field[:type] end |