Class: EfoNelfo::V40::VL
Instance Method Summary
collapse
Methods inherited from PostType
for, from, #initialize, parse, #post_type, post_type, #to_csv, version, #version, version_from_class, version_to_namespace
Methods included from HasMany
#add, #associations, #find_association, #has_association?, included, #to_a
Methods included from Properties
#has_property?, included, #initialize_attributes, #properties, #to_a
Instance Method Details
#gross_price ⇒ Object
36
37
38
|
# File 'lib/efo_nelfo/v40/vl.rb', line 36
def gross_price
gross_price? ? properties[:price].to_f : nil
end
|
#gross_price? ⇒ Boolean
32
33
34
|
# File 'lib/efo_nelfo/v40/vl.rb', line 32
def gross_price?
price_type.nil? || price_type == 'B'
end
|
#images ⇒ Object
48
49
50
|
# File 'lib/efo_nelfo/v40/vl.rb', line 48
def images
info.map(&:image).compact
end
|
#net_price ⇒ Object
40
41
42
|
# File 'lib/efo_nelfo/v40/vl.rb', line 40
def net_price
net_price? ? properties[:price].to_f : nil
end
|
#net_price? ⇒ Boolean
44
45
46
|
# File 'lib/efo_nelfo/v40/vl.rb', line 44
def net_price?
price_type == 'N'
end
|
#nrf_id ⇒ Object
28
29
30
|
# File 'lib/efo_nelfo/v40/vl.rb', line 28
def nrf_id
product_type == 4 ? product_number : nil
end
|
#urls ⇒ Object
Returns array of urls extracted from VX lines
59
60
61
|
# File 'lib/efo_nelfo/v40/vl.rb', line 59
def urls
info.map(&:value).select { |u| u.match %r{\Ahttps?://} }
end
|