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