Class: YourMembership::Sa::Export
- Defined in:
- lib/your_membership/sa_export.rb
Overview
The Export object provides a convenient abstraction that encapsulates the export process
Instance Attribute Summary collapse
-
#export_id ⇒ String
readonly
The unique ID assigned by the API when an export is initiated.
-
#export_uri ⇒ String
readonly
The uri from which to download the requested report once the status is :complete.
-
#status ⇒ Symbol
readonly
Instance implementation of the Sa::Export.status method that also sets the export_uri if the status is :complete.
Class Method Summary collapse
-
.all_invoiceItems(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of all invoice items.
-
.career_openings(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of career openings.
-
.donations_invoiceItems(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of donation invoice items.
-
.donations_transactions(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of donation transactions.
-
.dues_invoiceItems(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of dues invoice items.
-
.dues_transactions(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of dues transactions.
-
.event_registrations(event_id, unicode, options = {}) ⇒ YourMembership::Sa::Export
Starts an export of registration records for an event.
-
.status(export_id) ⇒ Hash
Returns the status of an export by ExportID.
-
.store_invoiceItems(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of store order invoice items.
-
.store_orders(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of store orders.
Instance Method Summary collapse
-
#initialize(export_id) ⇒ Export
constructor
Export Initializer - Use any of the public class methods to create objects of this type.
Methods inherited from Base
build_XML_request, new_call_id, post, response_to_array, response_to_array_of_hashes, response_valid?, response_ym_error?
Constructor Details
#initialize(export_id) ⇒ Export
There is not yet a compelling reason to call Export.new() directly, however it can be done.
Export Initializer - Use any of the public class methods to create objects of this type.
16 17 18 19 20 |
# File 'lib/your_membership/sa_export.rb', line 16 def initialize(export_id) @export_id = export_id @status = nil @export_uri = nil end |
Instance Attribute Details
#export_id ⇒ String (readonly)
The unique ID assigned by the API when an export is initiated
8 9 10 |
# File 'lib/your_membership/sa_export.rb', line 8 def export_id @export_id end |
#export_uri ⇒ String (readonly)
The uri from which to download the requested report once the status is :complete
8 9 10 |
# File 'lib/your_membership/sa_export.rb', line 8 def export_uri @export_uri end |
#status ⇒ Symbol (readonly)
Instance implementation of the Sa::Export.status method that also sets the export_uri if the status is :complete
8 9 10 |
# File 'lib/your_membership/sa_export.rb', line 8 def status @status end |
Class Method Details
.all_invoiceItems(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of all invoice items.
58 59 60 |
# File 'lib/your_membership/sa_export.rb', line 58 def self.all_invoiceItems(date, unicode) # rubocop:disable Style/MethodName generic_export('Sa.Export.All.InvoiceItems', date, unicode) end |
.career_openings(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of career openings.
69 70 71 |
# File 'lib/your_membership/sa_export.rb', line 69 def self.career_openings(date, unicode) generic_export('Sa.Export.Career.Openings', date, unicode) end |
.donations_invoiceItems(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of donation invoice items.
91 92 93 |
# File 'lib/your_membership/sa_export.rb', line 91 def self.donations_invoiceItems(date, unicode) # rubocop:disable Style/MethodName generic_export('Sa.Export.Donations.InvoiceItems', date, unicode) end |
.donations_transactions(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of donation transactions.
80 81 82 |
# File 'lib/your_membership/sa_export.rb', line 80 def self.donations_transactions(date, unicode) generic_export('Sa.Export.Donations.Transactions', date, unicode) end |
.dues_invoiceItems(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of dues invoice items.
113 114 115 |
# File 'lib/your_membership/sa_export.rb', line 113 def self.dues_invoiceItems(date, unicode) # rubocop:disable Style/MethodName generic_export('Sa.Export.Dues.InvoiceItems', date, unicode) end |
.dues_transactions(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of dues transactions.
102 103 104 |
# File 'lib/your_membership/sa_export.rb', line 102 def self.dues_transactions(date, unicode) generic_export('Sa.Export.Dues.Transactions', date, unicode) end |
.event_registrations(event_id, unicode, options = {}) ⇒ YourMembership::Sa::Export
Starts an export of registration records for an event
153 154 155 156 |
# File 'lib/your_membership/sa_export.rb', line 153 def self.event_registrations(event_id, unicode, = {}) # rubocop:disable Style/MethodName [:EventID] = event_id generic_export('Sa.Export.Event.Registrations', nil, unicode, ) end |
.status(export_id) ⇒ Hash
Returns the status of an export by ExportID. This method should be called until a status of either FAILURE or COMPLETE is returned.
41 42 43 44 45 46 47 48 49 |
# File 'lib/your_membership/sa_export.rb', line 41 def self.status(export_id) = {} [:ExportID] = export_id response = post('/', :body => build_XML_request('Sa.Export.Status', nil, )) response_valid? response response['YourMembership_Response']['Sa.Export.Status'] end |
.store_invoiceItems(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of store order invoice items.
135 136 137 |
# File 'lib/your_membership/sa_export.rb', line 135 def self.store_invoiceItems(date, unicode) # rubocop:disable Style/MethodName generic_export('Sa.Export.Store.InvoiceItems', date, unicode) end |
.store_orders(date, unicode) ⇒ YourMembership::Sa::Export
Starts an export of store orders.
124 125 126 |
# File 'lib/your_membership/sa_export.rb', line 124 def self.store_orders(date, unicode) generic_export('Sa.Export.Store.Orders', date, unicode) end |