Class: Euston::Websites::ApiCommandRequestParsing::BatchParser

Inherits:
AbstractParser
  • Object
show all
Defined in:
lib/euston-websites/api_command_request_parsing/batch_parser.rb

Instance Method Summary collapse

Methods inherited from AbstractParser

#parse

Constructor Details

#initialize(request, &block) ⇒ BatchParser

Returns a new instance of BatchParser.



5
6
7
8
# File 'lib/euston-websites/api_command_request_parsing/batch_parser.rb', line 5

def initialize request, &block
  super request
  @transformer = block
end

Instance Method Details

#transform_hash_to_commands(hash) ⇒ Object



10
11
12
# File 'lib/euston-websites/api_command_request_parsing/batch_parser.rb', line 10

def transform_hash_to_commands hash
  @transformer.call hash
end