Class: BigcommerceAPI::Store

Inherits:
Base
  • Object
show all
Defined in:
lib/bigcommerce_api/store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attributes, clean!, date_adjust, default_options, #store, #time, to_rfc2822

Constructor Details

#initialize(data) ⇒ Store

Sample response “domain”=>“XXXX.mybigcommerce.com”, “name”=>“XXXX”, “address”=>“”, “phone”=>“”, “admin_email”=>“XXX”, “order_email”=>“XXX”, “language”=>“en”, “currency”=>“USD”, “currency_symbol”=>“$”, “decimal_separator”=>“.”, “thousands_separator”=>“,”, “decimal_places”=>2, “currency_symbol_location”=>“left”, “weight_units”=>“LBS”, “dimension_units”=>“Inches”, “plan_name”=>“Partner Sandbox”



25
26
27
28
29
30
31
32
33
34
# File 'lib/bigcommerce_api/store.rb', line 25

def initialize(data)
  data.each do |k, v|
    if v and v.is_a? String
      val = v.gsub(/\n/, '').gsub(/\t/, '').strip
    else
      val = v
    end
    send(:"#{k}=", val) if self.respond_to? "#{k}="
  end
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def address
  @address
end

#admin_emailObject

Returns the value of attribute admin_email.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def admin_email
  @admin_email
end

#currencyObject

Returns the value of attribute currency.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def currency
  @currency
end

#currency_symbolObject

Returns the value of attribute currency_symbol.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def currency_symbol
  @currency_symbol
end

#currency_symbol_locationObject

Returns the value of attribute currency_symbol_location.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def currency_symbol_location
  @currency_symbol_location
end

#decimal_placesObject

Returns the value of attribute decimal_places.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def decimal_places
  @decimal_places
end

#decimal_separatorObject

Returns the value of attribute decimal_separator.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def decimal_separator
  @decimal_separator
end

#dimension_unitsObject

Returns the value of attribute dimension_units.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def dimension_units
  @dimension_units
end

#domainObject

Returns the value of attribute domain.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def domain
  @domain
end

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def errors
  @errors
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def id
  @id
end

#languageObject

Returns the value of attribute language.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def language
  @language
end

#logoObject

Returns the value of attribute logo.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def 
  @logo
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def name
  @name
end

#order_emailObject

Returns the value of attribute order_email.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def order_email
  @order_email
end

#phoneObject

Returns the value of attribute phone.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def phone
  @phone
end

#plan_nameObject

Returns the value of attribute plan_name.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def plan_name
  @plan_name
end

#thousands_separatorObject

Returns the value of attribute thousands_separator.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def thousands_separator
  @thousands_separator
end

#weight_unitsObject

Returns the value of attribute weight_units.



3
4
5
# File 'lib/bigcommerce_api/store.rb', line 3

def weight_units
  @weight_units
end