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.



256
257
258
259
# File 'lib/hookbridge/types.rb', line 256

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.



254
255
256
# File 'lib/hookbridge/types.rb', line 254

def lines
  @lines
end