Class: AdfBuilder::Prospect

Inherits:
Object
  • Object
show all
Defined in:
lib/adf_builder/base/prospect.rb

Constant Summary collapse

STATUSES =
{
  new: :new,
  resend: :resend
}

Instance Method Summary collapse

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

#customerObject



30
31
32
# File 'lib/adf_builder/base/prospect.rb', line 30

def customer
  @customer
end

#providerObject



38
39
40
# File 'lib/adf_builder/base/prospect.rb', line 38

def provider
  @provider
end

#request_dateObject



22
23
24
# File 'lib/adf_builder/base/prospect.rb', line 22

def request_date
  @request_date
end

#set_renewObject

set status to renew



43
44
45
# File 'lib/adf_builder/base/prospect.rb', line 43

def set_renew
  @prospect[:status] = STATUSES[:resend]
end

#vehiclesObject



26
27
28
# File 'lib/adf_builder/base/prospect.rb', line 26

def vehicles
  @vehicles
end

#vendorObject



34
35
36
# File 'lib/adf_builder/base/prospect.rb', line 34

def vendor
  @vendor
end