Class: Codat::Models::ReportItem
- Defined in:
- lib/codat/models/report_item.rb
Overview
A report item can be present in BalanceSheetReport or ProfitAndLossReport.
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
Instance Method Summary collapse
-
#initialize(json: {}) ⇒ ReportItem
constructor
A new instance of ReportItem.
Methods inherited from BaseModel
attributes, #format_url, format_url, get, #get, post, #post, successful_response?
Constructor Details
#initialize(json: {}) ⇒ ReportItem
Returns a new instance of ReportItem.
13 14 15 16 17 18 19 |
# File 'lib/codat/models/report_item.rb', line 13 def initialize(json: {}) super # The items can have an array of items inside. It's weird, but this happens a lot. items_json = json.fetch(:items, []) @items = items_json.map { |item| ReportItem.new(json: item) } end |
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
11 12 13 |
# File 'lib/codat/models/report_item.rb', line 11 def items @items end |