Class: Taro::ReturnDef
- Inherits:
-
Object
- Object
- Taro::ReturnDef
- Defined in:
- lib/taro/return_def.rb
Overview
Lazily-evaluated response type definition.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#defined_at ⇒ Object
readonly
Returns the value of attribute defined_at.
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#nesting ⇒ Object
readonly
Returns the value of attribute nesting.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(code:, defined_at: nil, desc: nil, nesting: nil, **params) ⇒ ReturnDef
constructor
A new instance of ReturnDef.
Constructor Details
#initialize(code:, defined_at: nil, desc: nil, nesting: nil, **params) ⇒ ReturnDef
Returns a new instance of ReturnDef.
5 6 7 8 9 10 11 12 |
# File 'lib/taro/return_def.rb', line 5 def initialize(code:, defined_at: nil, desc: nil, nesting: nil, **params) @code = Taro::StatusCode.coerce_to_int(code) @defined_at = defined_at @desc = desc @nesting = nesting @params = params validate end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/taro/return_def.rb', line 3 def code @code end |
#defined_at ⇒ Object (readonly)
Returns the value of attribute defined_at.
3 4 5 |
# File 'lib/taro/return_def.rb', line 3 def defined_at @defined_at end |
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
3 4 5 |
# File 'lib/taro/return_def.rb', line 3 def desc @desc end |
#nesting ⇒ Object (readonly)
Returns the value of attribute nesting.
3 4 5 |
# File 'lib/taro/return_def.rb', line 3 def nesting @nesting end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/taro/return_def.rb', line 3 def params @params end |