Class: Moov::Models::Components::ProductCategory

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

Overview

A product category from the product taxonomy.

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

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

Constructor Details

#initialize(category_id:, name:, full_name:, level:, parent_id: nil) ⇒ ProductCategory

Returns a new instance of ProductCategory.



27
28
29
30
31
32
33
# File 'lib/moov/models/components/productcategory.rb', line 27

def initialize(category_id:, name:, full_name:, level:, parent_id: nil)
  @category_id = category_id
  @name = name
  @full_name = full_name
  @level = level
  @parent_id = parent_id
end

Instance Method Details

#==(other) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/moov/models/components/productcategory.rb', line 36

def ==(other)
  return false unless other.is_a? self.class
  return false unless @category_id == other.category_id
  return false unless @name == other.name
  return false unless @full_name == other.full_name
  return false unless @level == other.level
  return false unless @parent_id == other.parent_id
  true
end