Module: TopsConnect::Owners

Included in:
Client
Defined in:
lib/tops_connect/owners.rb

Instance Method Summary collapse

Instance Method Details

#balance(owner_key) ⇒ Object

Method: GET Endpoint: Balance_Get Returns: Hash



30
31
32
# File 'lib/tops_connect/owners.rb', line 30

def balance(owner_key)
  get "/owner/#{owner_key}/balance"
end

#charges(owner_key) ⇒ Object

Method: GET Endpoint: Charge_Get Returns: Hash



37
38
39
# File 'lib/tops_connect/owners.rb', line 37

def charges(owner_key)
  get "/charge/#{owner_key}"
end

#owner(owner_key) ⇒ Object

Method: GET Endpoint: Owner_Get Returns: TopsConnect::Owner



23
24
25
# File 'lib/tops_connect/owners.rb', line 23

def owner(owner_key)
  TopsConnect::Owner.new get("/owner/#{owner_key}")
end

#owners(property_key = nil) ⇒ Object

Method: GET Endpoint: Owner_GetList Returns: Array<TopsConnect::Owner>



11
12
13
14
15
16
17
18
# File 'lib/tops_connect/owners.rb', line 11

def owners(property_key = nil)
  query = {}
  query['PropertyKey'] = property_key.to_i if property_key

  get('/owner', query: query).map do |owner_data|
    TopsConnect::Owner.new owner_data
  end
end

#update_owner!(owner_key, data) ⇒ Object

Method: PUT Endpoint: Owner_Put Returns: Hash



44
45
46
# File 'lib/tops_connect/owners.rb', line 44

def update_owner!(owner_key, data)
  put "/owner/#{owner_key}", body: data
end