Class: Prodamus::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/entities/product.rb

Overview

Some product to be sent to prodamus

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, price:, quantity: 1, sku: nil) ⇒ Product

Returns a new instance of Product.



10
11
12
13
14
15
# File 'lib/entities/product.rb', line 10

def initialize(name:, price:, quantity: 1, sku: nil)
  @sku = sku.to_s
  @name = name
  @price = price.to_s
  @quantity = quantity.to_s
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/entities/product.rb', line 8

def name
  @name
end

#priceObject (readonly)

Returns the value of attribute price.



8
9
10
# File 'lib/entities/product.rb', line 8

def price
  @price
end

#quantityObject (readonly)

Returns the value of attribute quantity.



8
9
10
# File 'lib/entities/product.rb', line 8

def quantity
  @quantity
end

#skuObject (readonly)

Returns the value of attribute sku.



8
9
10
# File 'lib/entities/product.rb', line 8

def sku
  @sku
end