Class: EDI::ArrayResponder
- Inherits:
-
Object
- Object
- EDI::ArrayResponder
- Defined in:
- lib/edi/utilities/array_responder.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ ArrayResponder
constructor
A new instance of ArrayResponder.
- #respond ⇒ Object
Constructor Details
#initialize(response) ⇒ ArrayResponder
Returns a new instance of ArrayResponder.
5 6 7 |
# File 'lib/edi/utilities/array_responder.rb', line 5 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
3 4 5 |
# File 'lib/edi/utilities/array_responder.rb', line 3 def response @response end |
Instance Method Details
#respond ⇒ Object
9 10 11 12 13 14 |
# File 'lib/edi/utilities/array_responder.rb', line 9 def respond case response when String then [response] when Array then response end.sample end |