Class: Scene7::Company

Inherits:
Object
  • Object
show all
Defined in:
lib/scene7/company.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Company

Returns a new instance of Company.



13
14
15
# File 'lib/scene7/company.rb', line 13

def initialize(attributes)
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



11
12
13
# File 'lib/scene7/company.rb', line 11

def attributes
  @attributes
end

Class Method Details

.find_by_name(name) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/scene7/company.rb', line 3

def self.find_by_name(name)
  response = Scene7::Client.perform_request(:get_company_info, :company_name => name)
  
  company_data = response.to_hash[:get_company_info_return][:company_info]
  
  new(company_data)
end

Instance Method Details

#handleObject



21
22
23
# File 'lib/scene7/company.rb', line 21

def handle
  attributes[:company_handle]
end

#nameObject



17
18
19
# File 'lib/scene7/company.rb', line 17

def name
  attributes[:name]
end

#root_pathObject



25
26
27
# File 'lib/scene7/company.rb', line 25

def root_path
  attributes[:root_path]
end