Class: Beanie::Product

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Api

all, build_url, #construct_path, delete, #extract, #field_name, find, get, #object_name, #populate, post, put, #save!, set_headers

Constructor Details

#initializeProduct

Initialize instance variables



37
38
39
40
41
42
43
44
45
46
# File 'lib/beanie/product.rb', line 37

def initialize
  @id = nil
  @description = nil
  @name = nil
  @code = nil
  @is_service = nil
  @nominal_account_id = nil
  @product_category_id = nil
  @unit_of_measure = nil
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



32
33
34
# File 'lib/beanie/product.rb', line 32

def code
  @code
end

#descriptionObject

Returns the value of attribute description.



32
33
34
# File 'lib/beanie/product.rb', line 32

def description
  @description
end

#idObject

Returns the value of attribute id.



32
33
34
# File 'lib/beanie/product.rb', line 32

def id
  @id
end

#is_serviceObject

Returns the value of attribute is_service.



32
33
34
# File 'lib/beanie/product.rb', line 32

def is_service
  @is_service
end

#nameObject

Returns the value of attribute name.



32
33
34
# File 'lib/beanie/product.rb', line 32

def name
  @name
end

#nominal_account_idObject

Returns the value of attribute nominal_account_id.



33
34
35
# File 'lib/beanie/product.rb', line 33

def 
  @nominal_account_id
end

#product_category_idObject

Returns the value of attribute product_category_id.



33
34
35
# File 'lib/beanie/product.rb', line 33

def product_category_id
  @product_category_id
end

#unit_of_measureObject

Returns the value of attribute unit_of_measure.



33
34
35
# File 'lib/beanie/product.rb', line 33

def unit_of_measure
  @unit_of_measure
end

Class Method Details

.find_by_name(name) ⇒ Object



48
49
50
# File 'lib/beanie/product.rb', line 48

def self.find_by_name(name)
  Beanie.find("products", "name", name)
end