Class: HookBridge::Invoice
- Defined in:
- lib/hookbridge/types.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
Instance Method Summary collapse
-
#initialize(data) ⇒ Invoice
constructor
A new instance of Invoice.
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
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
254 255 256 |
# File 'lib/hookbridge/types.rb', line 254 def lines @lines end |