Class: Codat::Models::ProfitAndLossReport
- Defined in:
- lib/codat/models/profit_and_loss_report.rb
Instance Attribute Summary collapse
-
#cost_of_sales ⇒ Object
Returns the value of attribute cost_of_sales.
-
#expenses ⇒ Object
Returns the value of attribute expenses.
-
#income ⇒ Object
Returns the value of attribute income.
-
#other_expenses ⇒ Object
Returns the value of attribute other_expenses.
-
#other_income ⇒ Object
Returns the value of attribute other_income.
Instance Method Summary collapse
-
#initialize(json: {}) ⇒ ProfitAndLossReport
constructor
A new instance of ProfitAndLossReport.
Methods inherited from BaseModel
attributes, #format_url, format_url, get, #get, post, #post, successful_response?
Constructor Details
#initialize(json: {}) ⇒ ProfitAndLossReport
Returns a new instance of ProfitAndLossReport.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/codat/models/profit_and_loss_report.rb', line 15 def initialize(json: {}) super @from_date = Date.parse(json.fetch(:fromDate)) @to_date = Date.parse(json.fetch(:toDate)) @income = ReportItem.new(json: json.fetch(:income, {})) @cost_of_sales = ReportItem.new(json: json.fetch(:costOfSales, {})) @expenses = ReportItem.new(json: json.fetch(:expenses, {})) @other_expenses = ReportItem.new(json: json.fetch(:otherExpenses, {})) @other_income = ReportItem.new(json: json.fetch(:otherIncome, {})) end |
Instance Attribute Details
#cost_of_sales ⇒ Object
Returns the value of attribute cost_of_sales.
13 14 15 |
# File 'lib/codat/models/profit_and_loss_report.rb', line 13 def cost_of_sales @cost_of_sales end |
#expenses ⇒ Object
Returns the value of attribute expenses.
13 14 15 |
# File 'lib/codat/models/profit_and_loss_report.rb', line 13 def expenses @expenses end |
#income ⇒ Object
Returns the value of attribute income.
13 14 15 |
# File 'lib/codat/models/profit_and_loss_report.rb', line 13 def income @income end |
#other_expenses ⇒ Object
Returns the value of attribute other_expenses.
13 14 15 |
# File 'lib/codat/models/profit_and_loss_report.rb', line 13 def other_expenses @other_expenses end |
#other_income ⇒ Object
Returns the value of attribute other_income.
13 14 15 |
# File 'lib/codat/models/profit_and_loss_report.rb', line 13 def other_income @other_income end |