Class: Reelagram::Mail::Processors::ShippingProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/reelagram/mail/processors/shipping_processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, parser) ⇒ ShippingProcessor

Returns a new instance of ShippingProcessor.



9
10
11
12
# File 'lib/reelagram/mail/processors/shipping_processor.rb', line 9

def initialize(data, parser)
  @data    = [data].flatten
  @parser  = parser
end

Instance Attribute Details

#current_stringObject (readonly)

Returns the value of attribute current_string.



6
7
8
# File 'lib/reelagram/mail/processors/shipping_processor.rb', line 6

def current_string
  @current_string
end

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/reelagram/mail/processors/shipping_processor.rb', line 5

def data
  @data
end

#parserObject (readonly)

Returns the value of attribute parser.



5
6
7
# File 'lib/reelagram/mail/processors/shipping_processor.rb', line 5

def parser
  @parser
end

#resultsObject (readonly)

Returns the value of attribute results.



7
8
9
# File 'lib/reelagram/mail/processors/shipping_processor.rb', line 7

def results
  @results
end

Instance Method Details

#runObject



14
15
16
# File 'lib/reelagram/mail/processors/shipping_processor.rb', line 14

def run
  data.map { |email| process_email(email[:body]) }
end