Class: AocCli::Core::Request

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/aoc_cli/core/request.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:) ⇒ Request

Returns a new instance of Request.



10
11
12
# File 'lib/aoc_cli/core/request.rb', line 10

def initialize(token:)
  @client = setup_client!(token)
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/aoc_cli/core/request.rb', line 6

def client
  @client
end

Class Method Details

.buildObject



14
15
16
17
18
19
20
# File 'lib/aoc_cli/core/request.rb', line 14

def self.build
  token = AocCli.config.session.token

  raise "session token not set" if token.nil?

  new(token:)
end