Class: MiniTools::Response
- Inherits:
-
Object
- Object
- MiniTools::Response
- Defined in:
- lib/mini_tools/response.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result, *args) ⇒ Response
constructor
A new instance of Response.
- #on(*outcome) {|args| ... } ⇒ Object
Constructor Details
#initialize(result, *args) ⇒ Response
5 6 7 8 |
# File 'lib/mini_tools/response.rb', line 5 def initialize result, *args @result = result @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/mini_tools/response.rb', line 3 def args @args end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
3 4 5 |
# File 'lib/mini_tools/response.rb', line 3 def result @result end |
Instance Method Details
#on(*outcome) {|args| ... } ⇒ Object
10 11 12 |
# File 'lib/mini_tools/response.rb', line 10 def on *outcome yield(*args) if outcome.include?(result) end |