Class: Printavo::Inquiry
Instance Method Summary
collapse
#==, #[], #dig, #initialize, #inspect, #to_h
Instance Method Details
#customer ⇒ Object
24
25
26
27
|
# File 'lib/printavo/models/inquiry.rb', line 24
def customer
attrs = self['customer']
Customer.new(attrs) if attrs
end
|
#id ⇒ Object
6
|
# File 'lib/printavo/models/inquiry.rb', line 6
def id = self['id']
|
#nickname ⇒ Object
7
|
# File 'lib/printavo/models/inquiry.rb', line 7
def nickname = self['nickname']
|
#status ⇒ Object
10
11
12
|
# File 'lib/printavo/models/inquiry.rb', line 10
def status
dig('status', 'name')
end
|
#status?(key) ⇒ Boolean
20
21
22
|
# File 'lib/printavo/models/inquiry.rb', line 20
def status?(key)
status_key == key.to_sym
end
|
#status_key ⇒ Object
14
15
16
17
18
|
# File 'lib/printavo/models/inquiry.rb', line 14
def status_key
return nil if status.nil?
status.downcase.gsub(/\s+/, '_').to_sym
end
|
#total_price ⇒ Object
8
|
# File 'lib/printavo/models/inquiry.rb', line 8
def total_price = self['totalPrice']
|