Class: E4commerce::E4CProduct

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/e4commerce/product.rb

Overview

class E4CProduct < ActiveRecord::Base -> Rails project, need database

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, serial_number, brand, unit_price) ⇒ E4CProduct

Returns a new instance of E4CProduct.



15
16
17
18
19
20
# File 'lib/e4commerce/product.rb', line 15

def initialize(title, serial_number, brand, unit_price)
	@title = title
	@serial_number = serial_number
	@brand = brand
	@unit_price = unit_price
end

Instance Attribute Details

#brandObject

Returns the value of attribute brand.



12
13
14
# File 'lib/e4commerce/product.rb', line 12

def brand
  @brand
end

#serial_numberObject

Returns the value of attribute serial_number.



11
12
13
# File 'lib/e4commerce/product.rb', line 11

def serial_number
  @serial_number
end

#titleObject

Returns the value of attribute title.



10
11
12
# File 'lib/e4commerce/product.rb', line 10

def title
  @title
end

#unit_priceObject

Returns the value of attribute unit_price.



13
14
15
# File 'lib/e4commerce/product.rb', line 13

def unit_price
  @unit_price
end

Instance Method Details

#saleObject



26
27
28
# File 'lib/e4commerce/product.rb', line 26

def sale
  raise 'Abstract method'
end

#searchObject



22
23
24
# File 'lib/e4commerce/product.rb', line 22

def search
  raise 'Abstract method'
end