Class: Teilashare::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/teilashare/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
12
# File 'lib/teilashare/client.rb', line 7

def initialize(opts)
  @token = opts[:token]
  @api_secret = opts[:api_secret]
  @affiliate_id = opts[:affiliate_id]
  @api_version = opts[:api_version] || default_api_version
end

Instance Attribute Details

#affiliate_idObject

Returns the value of attribute affiliate_id.



5
6
7
# File 'lib/teilashare/client.rb', line 5

def affiliate_id
  @affiliate_id
end

#api_secretObject

Returns the value of attribute api_secret.



5
6
7
# File 'lib/teilashare/client.rb', line 5

def api_secret
  @api_secret
end

#api_versionObject

Returns the value of attribute api_version.



5
6
7
# File 'lib/teilashare/client.rb', line 5

def api_version
  @api_version
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/teilashare/client.rb', line 5

def token
  @token
end

Instance Method Details

#activity_details(opts = {}) ⇒ Object



18
19
20
# File 'lib/teilashare/client.rb', line 18

def activity_details(opts = {})
  Resources::ActivityDetail.new(self, opts).call
end

#activity_summary(opts = {}) ⇒ Object



22
23
24
# File 'lib/teilashare/client.rb', line 22

def activity_summary(opts = {})
  Resources::ActivitySummary.new(self, opts).call
end

#api_token_count(opts = {}) ⇒ Object



46
47
48
# File 'lib/teilashare/client.rb', line 46

def api_token_count(opts = {})
  Resources::ApiTokenCount.new(self, opts).call
end

#balance_inquiry(opts = {}) ⇒ Object



102
103
104
# File 'lib/teilashare/client.rb', line 102

def balance_inquiry(opts = {})
  Resources::BalanceInquiry.new(self, opts).call
end

#coupon_deal(opts = {}) ⇒ Object



66
67
68
# File 'lib/teilashare/client.rb', line 66

def coupon_deal(opts = {})
  Resources::CouponDeal.new(self, opts).call
end

#default_api_versionObject



14
15
16
# File 'lib/teilashare/client.rb', line 14

def default_api_version
  2.3
end

#edit_trail(opts = {}) ⇒ Object



82
83
84
# File 'lib/teilashare/client.rb', line 82

def edit_trail(opts = {})
  Resources::EditTrail.new(self, opts).call
end


54
55
56
# File 'lib/teilashare/client.rb', line 54

def invalid_links(opts = {})
  Resources::InvalidLinks.new(self, opts).call
end

#ledger_report(opts = {}) ⇒ Object



98
99
100
# File 'lib/teilashare/client.rb', line 98

def ledger_report(opts = {})
  Resources::LedgerReport.new(self, opts).call
end

#merchant_creative(opts = {}) ⇒ Object



74
75
76
# File 'lib/teilashare/client.rb', line 74

def merchant_creative(opts = {})
  Resources::MerchantCreative.new(self, opts).call
end

#merchant_datafeed(opts = {}) ⇒ Object



62
63
64
# File 'lib/teilashare/client.rb', line 62

def merchant_datafeed(opts = {})
  Resources::MerchantDatafeed.new(self, opts).call
end

#merchant_gift_card(opts = {}) ⇒ Object



78
79
80
# File 'lib/teilashare/client.rb', line 78

def merchant_gift_card(opts = {})
  Resources::MerchantGiftCard.new(self, opts).call
end

#merchant_search(opts = {}) ⇒ Object



90
91
92
# File 'lib/teilashare/client.rb', line 90

def merchant_search(opts = {})
  Resources::MerchantSearch.new(self, opts).call
end

#merchant_search_by_product(opts = {}) ⇒ Object



94
95
96
# File 'lib/teilashare/client.rb', line 94

def merchant_search_by_product(opts = {})
  Resources::MerchantSearchByProduct.new(self, opts).call
end

#merchant_status(opts = {}) ⇒ Object



70
71
72
# File 'lib/teilashare/client.rb', line 70

def merchant_status(opts = {})
  Resources::MerchantStatus.new(self, opts).call
end

#merchant_timespan(opts = {}) ⇒ Object



26
27
28
# File 'lib/teilashare/client.rb', line 26

def merchant_timespan(opts = {})
  Resources::MerchantTimespan.new(self, opts).call
end

#monthly_summary(opts = {}) ⇒ Object



34
35
36
# File 'lib/teilashare/client.rb', line 34

def monthly_summary(opts = {})
  Resources::MonthlySummary.new(self, opts).call
end

#order_inquiry(opts = {}) ⇒ Object



58
59
60
# File 'lib/teilashare/client.rb', line 58

def order_inquiry(opts = {})
  Resources::OrderInquiry.new(self, opts).call
end

#payment_summary(opts = {}) ⇒ Object



86
87
88
# File 'lib/teilashare/client.rb', line 86

def payment_summary(opts = {})
  Resources::PaymentSummary.new(self, opts).call
end

#products(opts = {}) ⇒ Object



50
51
52
# File 'lib/teilashare/client.rb', line 50

def products(opts = {})
  Resources::Products.new(self, opts).call
end

#today_stats(opts = {}) ⇒ Object



30
31
32
# File 'lib/teilashare/client.rb', line 30

def today_stats(opts = {})
  Resources::TodayStats.new(self, opts).call
end

#traffic(opts = {}) ⇒ Object



42
43
44
# File 'lib/teilashare/client.rb', line 42

def traffic(opts = {})
  Resources::Traffic.new(self, opts).call
end

#void_trail(opts = {}) ⇒ Object



38
39
40
# File 'lib/teilashare/client.rb', line 38

def void_trail(opts = {})
  Resources::VoidTrail.new(self, opts).call
end