Class: AdfBuilder::Prospect
- Inherits:
-
Object
- Object
- AdfBuilder::Prospect
- Defined in:
- lib/adf_builder/base/prospect.rb
Constant Summary collapse
- STATUSES =
{ new: :new, resend: :resend }
Instance Method Summary collapse
- #add_id(value, source = nil, sequence = 1) ⇒ Object
- #customer ⇒ Object
-
#initialize(doc) ⇒ Prospect
constructor
A new instance of Prospect.
- #provider ⇒ Object
- #request_date ⇒ Object
-
#set_renew ⇒ Object
set status to renew.
- #vehicles ⇒ Object
- #vendor ⇒ Object
Constructor Details
#initialize(doc) ⇒ Prospect
Returns a new instance of Prospect.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/adf_builder/base/prospect.rb', line 8 def initialize(doc) @doc = doc @doc.adf << Ox::Element.new("prospect") @prospect = @doc.adf.prospect @prospect[:status] = STATUSES[:new] @request_date = RequestDate.new(@prospect) @vehicles = Vehicles.new(@prospect) @customer = Customer.new(@prospect) @vendor = Vendor.new(@prospect) @provider = Provider.new(@prospect) end |
Instance Method Details
#add_id(value, source = nil, sequence = 1) ⇒ Object
47 48 49 |
# File 'lib/adf_builder/base/prospect.rb', line 47 def add_id(value, source=nil, sequence=1) Id.new.add(@prospect, value, source, sequence) end |
#customer ⇒ Object
30 31 32 |
# File 'lib/adf_builder/base/prospect.rb', line 30 def customer @customer end |
#provider ⇒ Object
38 39 40 |
# File 'lib/adf_builder/base/prospect.rb', line 38 def provider @provider end |
#request_date ⇒ Object
22 23 24 |
# File 'lib/adf_builder/base/prospect.rb', line 22 def request_date @request_date end |
#set_renew ⇒ Object
set status to renew
43 44 45 |
# File 'lib/adf_builder/base/prospect.rb', line 43 def set_renew @prospect[:status] = STATUSES[:resend] end |
#vehicles ⇒ Object
26 27 28 |
# File 'lib/adf_builder/base/prospect.rb', line 26 def vehicles @vehicles end |
#vendor ⇒ Object
34 35 36 |
# File 'lib/adf_builder/base/prospect.rb', line 34 def vendor @vendor end |