Class: TaobaoApi::Shop

Inherits:
Object
  • Object
show all
Includes:
BaseApi
Defined in:
lib/taobao_api/shop.rb

Constant Summary collapse

@@configurable_attrs =
[:nick, :level, :title, :created, :address, :item_score, :service_score, :delivery_score, :praise_rate, :type, :shop_score]

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseApi

included, init_config, valid_config

Class Method Details

.<<(item) ⇒ Object



11
12
13
14
15
16
# File 'lib/taobao_api/shop.rb', line 11

def @@configurable_attrs.<<(item)
  return self if item.blank?
  super(item.to_sym).uniq!
  TaobaoApi::Shop.send :attr_reader, item.to_sym
  self
end

.get_taobao_shop(nick) ⇒ Object



18
19
20
21
22
23
# File 'lib/taobao_api/shop.rb', line 18

def self.get_taobao_shop(nick)
  options = get_result(nick)
  return nil if options.blank?

  new options
end

Instance Method Details

#is_taobao?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/taobao_api/shop.rb', line 29

def is_taobao?
  @type == 'C'
end

#is_tmall?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/taobao_api/shop.rb', line 25

def is_tmall?
  @type == 'B'
end