class Codat::Models::ReportItem

A report item can be present in BalanceSheetReport or ProfitAndLossReport.

Attributes

items[RW]

Public Class Methods

new(json: {}) click to toggle source
Calls superclass method Codat::BaseModel::new
# 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