Class: Beanie::SalesOrder
Constant Summary collapse
- BILL_FREQUENCY_DAILY =
0- BILL_FREQUENCY_WEEKLY =
1- BILL_FREQUENCY_FORTNIGHTLY =
2- BILL_FREQUENCY_MONTHLY =
3- BILL_FREQUENCY_QUARTERLY =
4- BILL_FREQUENCY_ANNUALLY =
5- BILL_FREQUENCY_NAMES =
[ ["Daily", BILL_FREQUENCY_DAILY], ["Weekly", BILL_FREQUENCY_WEEKLY], ["Fortnightly", BILL_FREQUENCY_FORTNIGHTLY], ["Monthly", BILL_FREQUENCY_MONTHLY], ["Quarterly", BILL_FREQUENCY_QUARTERLY], ["Yearly", BILL_FREQUENCY_ANNUALLY] ].freeze
Instance Attribute Summary collapse
-
#billing_frequency ⇒ Object
Returns the value of attribute billing_frequency.
-
#cash_customer_ref ⇒ Object
Returns the value of attribute cash_customer_ref.
-
#currency_id ⇒ Object
Returns the value of attribute currency_id.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#date ⇒ Object
Returns the value of attribute date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#number ⇒ Object
Returns the value of attribute number.
-
#title ⇒ Object
Returns the value of attribute title.
-
#your_ref ⇒ Object
Returns the value of attribute your_ref.
Instance Method Summary collapse
-
#frequency_name ⇒ Object
Pretty name for the frequency.
-
#initialize ⇒ SalesOrder
constructor
Initialize instance variables.
Methods inherited from Api
all, build_url, #construct_path, delete, #extract, #field_name, find, get, #object_name, #populate, post, put, #save!, set_headers
Constructor Details
#initialize ⇒ SalesOrder
Initialize instance variables
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/beanie/sales_order.rb', line 53 def initialize @id = nil @cash_customer_ref = nil @number = nil @date = nil @title = nil @billing_frequency = BILL_FREQUENCY_DAILY @your_ref = nil @currency = nil @customer_id = nil end |
Instance Attribute Details
#billing_frequency ⇒ Object
Returns the value of attribute billing_frequency.
32 33 34 |
# File 'lib/beanie/sales_order.rb', line 32 def billing_frequency @billing_frequency end |
#cash_customer_ref ⇒ Object
Returns the value of attribute cash_customer_ref.
32 33 34 |
# File 'lib/beanie/sales_order.rb', line 32 def cash_customer_ref @cash_customer_ref end |
#currency_id ⇒ Object
Returns the value of attribute currency_id.
33 34 35 |
# File 'lib/beanie/sales_order.rb', line 33 def currency_id @currency_id end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
33 34 35 |
# File 'lib/beanie/sales_order.rb', line 33 def customer_id @customer_id end |
#date ⇒ Object
Returns the value of attribute date.
32 33 34 |
# File 'lib/beanie/sales_order.rb', line 32 def date @date end |
#id ⇒ Object
Returns the value of attribute id.
32 33 34 |
# File 'lib/beanie/sales_order.rb', line 32 def id @id end |
#number ⇒ Object
Returns the value of attribute number.
32 33 34 |
# File 'lib/beanie/sales_order.rb', line 32 def number @number end |
#title ⇒ Object
Returns the value of attribute title.
32 33 34 |
# File 'lib/beanie/sales_order.rb', line 32 def title @title end |
#your_ref ⇒ Object
Returns the value of attribute your_ref.
33 34 35 |
# File 'lib/beanie/sales_order.rb', line 33 def your_ref @your_ref end |
Instance Method Details
#frequency_name ⇒ Object
Pretty name for the frequency
67 68 69 70 71 72 |
# File 'lib/beanie/sales_order.rb', line 67 def frequency_name BILL_FREQUENCY_NAMES.each do |fn| return fn[0] if fn[1] == self.billing_frequency end return "Unknown?" end |