Class: HookBridge::Invoice

Inherits:
BaseModel show all
Defined in:
lib/hookbridge/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#method_missing, #respond_to_missing?, #to_h

Constructor Details

#initialize(data) ⇒ Invoice

Returns a new instance of Invoice.



244
245
246
247
# File 'lib/hookbridge/types.rb', line 244

def initialize(data)
  super(data, time_fields: %w[period_start period_end created])
  @lines = (data["lines"] || []).map { |entry| InvoiceLine.new(entry) }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HookBridge::BaseModel

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



242
243
244
# File 'lib/hookbridge/types.rb', line 242

def lines
  @lines
end