Class: Sparrow::Strategies::RackBodyJsonFormatStrategy
- Inherits:
-
JsonFormatStrategy
- Object
- JsonFormatStrategy
- Sparrow::Strategies::RackBodyJsonFormatStrategy
- Defined in:
- lib/sparrow/strategies/json_format_strategies/rack_body_json_format_strategy.rb
Instance Method Summary collapse
-
#convert(input) ⇒ String
The input body.
-
#match?(input) ⇒ Boolean
Checks if the input is a RackBody.
Methods inherited from JsonFormatStrategy
convert, #initialize, register_json_format
Constructor Details
This class inherits a constructor from Sparrow::Strategies::JsonFormatStrategy
Instance Method Details
#convert(input) ⇒ String
Returns the input body.
17 18 19 |
# File 'lib/sparrow/strategies/json_format_strategies/rack_body_json_format_strategy.rb', line 17 def convert(input) input.body end |
#match?(input) ⇒ Boolean
Checks if the input is a RackBody
10 11 12 |
# File 'lib/sparrow/strategies/json_format_strategies/rack_body_json_format_strategy.rb', line 10 def match?(input) input.respond_to?(:body) end |