Class: Moov::Models::Components::InvoiceLineItem

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Crystalline::MetadataFields
Defined in:
lib/moov/models/components/invoicelineitem.rb

Overview

Represents a single item in an invoice, including optional modifiers and quantity.

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

#field, #fields, included, #marshal_single, #to_dict, #to_json

Constructor Details

#initialize(name:, base_price:, quantity:, product_id: nil, options: nil, images: nil) ⇒ InvoiceLineItem

Returns a new instance of InvoiceLineItem.



31
32
33
34
35
36
37
38
# File 'lib/moov/models/components/invoicelineitem.rb', line 31

def initialize(name:, base_price:, quantity:, product_id: nil, options: nil, images: nil)
  @name = name
  @base_price = base_price
  @quantity = quantity
  @product_id = product_id
  @options = options
  @images = images
end

Instance Method Details

#==(other) ⇒ Object



41
42
43
44
45
46
47
48
49
50
# File 'lib/moov/models/components/invoicelineitem.rb', line 41

def ==(other)
  return false unless other.is_a? self.class
  return false unless @name == other.name
  return false unless @base_price == other.base_price
  return false unless @quantity == other.quantity
  return false unless @product_id == other.product_id
  return false unless @options == other.options
  return false unless @images == other.images
  true
end