Class: Marvel::Api::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/marvel/api/request.rb

Constant Summary collapse

GET =
'get'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, args: {}, options: {}) ⇒ Request

Returns a new instance of Request.



8
9
10
11
12
# File 'lib/marvel/api/request.rb', line 8

def initialize(path:, args: {}, options: {})
  @raw_path = path
  @raw_args = args
  @raw_options = options
end

Instance Attribute Details

#raw_argsObject (readonly)

Returns the value of attribute raw_args.



4
5
6
# File 'lib/marvel/api/request.rb', line 4

def raw_args
  @raw_args
end

#raw_optionsObject (readonly)

Returns the value of attribute raw_options.



4
5
6
# File 'lib/marvel/api/request.rb', line 4

def raw_options
  @raw_options
end

#raw_pathObject (readonly)

Returns the value of attribute raw_path.



4
5
6
# File 'lib/marvel/api/request.rb', line 4

def raw_path
  @raw_path
end

Instance Method Details

#argsObject



22
23
24
# File 'lib/marvel/api/request.rb', line 22

def args
  raw_args
end

#optionsObject



26
27
28
# File 'lib/marvel/api/request.rb', line 26

def options
  raw_options
end

#pathObject



18
19
20
# File 'lib/marvel/api/request.rb', line 18

def path
  "/v1/public/#{raw_path}"
end

#serverObject



30
31
32
# File 'lib/marvel/api/request.rb', line 30

def server
  Marvel::Api::DEFAULT_SERVER
end

#verbObject



14
15
16
# File 'lib/marvel/api/request.rb', line 14

def verb
  GET
end