Class: Moov::Models::Components::Product

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

Overview

A good or service offered by a merchant.

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

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

Constructor Details

#initialize(product_id:, title:, base_price:, created_on:, updated_on:, description: nil, option_groups: nil, images: nil, disabled_on: nil) ⇒ Product

Returns a new instance of Product.



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

def initialize(product_id:, title:, base_price:, created_on:, updated_on:, description: nil, option_groups: nil, images: nil, disabled_on: nil)
  @product_id = product_id
  @title = title
  @base_price = base_price
  @created_on = created_on
  @updated_on = updated_on
  @description = description
  @option_groups = option_groups
  @images = images
  @disabled_on = disabled_on
end

Instance Method Details

#==(other) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/moov/models/components/product.rb', line 52

def ==(other)
  return false unless other.is_a? self.class
  return false unless @product_id == other.product_id
  return false unless @title == other.title
  return false unless @base_price == other.base_price
  return false unless @created_on == other.created_on
  return false unless @updated_on == other.updated_on
  return false unless @description == other.description
  return false unless @option_groups == other.option_groups
  return false unless @images == other.images
  return false unless @disabled_on == other.disabled_on
  true
end