Module: Shushu::ResOwn

Extended by:
ResOwn
Included in:
ResOwn
Defined in:
lib/models/res_own.rb

Instance Method Summary collapse

Instance Method Details

#act(args) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/models/res_own.rb', line 5

def act(args)
  aid, eid = args.delete(:account_id), args.delete(:entity_id)
  args[:state] = "active"
  Shushu.handle_req do
    RestClient.put(res_own_url(aid, eid), args, Shushu.headers)
  end
end

#deact(args) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/models/res_own.rb', line 13

def deact(args)
  aid, eid = args.delete(:account_id), args.delete(:entity_id)
  args[:state] = "inactive"
  Shushu.handle_req do
    RestClient.put(res_own_url(aid, eid), args, Shushu.headers)
  end
end

#res_own_url(account_id, entity_id) ⇒ Object



21
22
23
# File 'lib/models/res_own.rb', line 21

def res_own_url(, entity_id)
  [Shushu.url, "/accounts/#{}/resource_ownerships/#{entity_id}"].join
end