Class: OrderReporting::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/order_reporting/report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Report

Returns a new instance of Report.



5
6
7
# File 'lib/order_reporting/report.rb', line 5

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/order_reporting/report.rb', line 3

def name
  @name
end

Instance Method Details

#send_reportObject



9
10
11
12
13
# File 'lib/order_reporting/report.rb', line 9

def send_report
  orders.tap do |orders|
    deliver(mailer.send(@name, orders))
  end
end