Class: Stackd::Client

Inherits:
Object
  • Object
show all
Includes:
Stackd::Concerns::RequireAttr, Stackd::Concerns::TattrAccessor
Defined in:
lib/stackd/client.rb

Instance Method Summary collapse

Methods included from Stackd::Concerns::RequireAttr

#require_attr!

Methods included from Stackd::Concerns::TattrAccessor

#tattr?

Constructor Details

#initialize(attrs) ⇒ Client

Returns a new instance of Client.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/stackd/client.rb', line 9

def initialize attrs
  attrs.each do |attr, val|
    public_send :"#{attr}=", val
  end

  begin
    require_attr! :id, :secret
  rescue Concerns::RequireAttr::AttrNotSetError => e
    raise ArgumentError.new e.message
  end
end

Instance Method Details

#auth_requestsObject



21
22
23
# File 'lib/stackd/client.rb', line 21

def auth_requests
  @auth_requests ||= Util::Portal.new self, AuthRequest
end

#tokensObject



25
26
27
# File 'lib/stackd/client.rb', line 25

def tokens
  @tokens ||= Util::Portal.new self, Token
end