Class: Riddl::Parameter::Simple
- Inherits:
-
Object
- Object
- Riddl::Parameter::Simple
- Defined in:
- lib/ruby/riddl/parameter.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value, type = :body) ⇒ Simple
constructor
A new instance of Simple.
- #to_json ⇒ Object
Constructor Details
#initialize(name, value, type = :body) ⇒ Simple
Returns a new instance of Simple.
20 21 22 23 24 |
# File 'lib/ruby/riddl/parameter.rb', line 20 def initialize(name,value,type=:body) @name = name @value = value @type = (type == :query ? :query : :body) end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/ruby/riddl/parameter.rb', line 16 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/ruby/riddl/parameter.rb', line 16 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
16 17 18 |
# File 'lib/ruby/riddl/parameter.rb', line 16 def value @value end |
Instance Method Details
#to_json ⇒ Object
17 18 19 |
# File 'lib/ruby/riddl/parameter.rb', line 17 def to_json(*) "{\"name\": \"#{@name}\", \"value\": \"#{@value}\"}" end |