Class: DiscountNetwork::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/discountnetwork/account.rb

Instance Method Summary collapse

Methods inherited from Base

method_missing

Instance Method Details

#create(attributes) ⇒ Object



10
11
12
# File 'lib/discountnetwork/account.rb', line 10

def create(attributes)
  DiscountNetwork.post_resource("account", subscriber: attributes)
end

#find(auth_token = nil) ⇒ Object



3
4
5
6
7
8
# File 'lib/discountnetwork/account.rb', line 3

def find(auth_token = nil)
  (auth_token)
  if auth_token_exists?
    DiscountNetwork.get_resource("account").user
  end
end

#update(attributes) ⇒ Object



14
15
16
17
18
# File 'lib/discountnetwork/account.rb', line 14

def update(attributes)
  if auth_token_exists?
    DiscountNetwork.put_resource("account", subscriber: attributes)
  end
end