Class: TecDoc::Brand

Inherits:
Object
  • Object
show all
Defined in:
lib/tec_doc/brand.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/tec_doc/brand.rb', line 3

def name
  @name
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/tec_doc/brand.rb', line 3

def number
  @number
end

Class Method Details

.allArray<TecDoc::Brand>

Get all brands available for provider.

Returns:



8
9
10
11
12
13
14
15
16
# File 'lib/tec_doc/brand.rb', line 8

def self.all
  response = TecDoc.client.request(:get_brands_for_assortment)
  response.map do |attributes|
    manufacturer = new
    manufacturer.number = attributes[:brand_no].to_i
    manufacturer.name = attributes[:brand_name].to_s
    manufacturer
  end
end