Class: ComicVine::Api::Request
- Inherits:
-
Object
- Object
- ComicVine::Api::Request
- Defined in:
- lib/comic_vine/api/request.rb
Constant Summary collapse
- GET =
'get'.freeze
Instance Attribute Summary collapse
-
#raw_args ⇒ Object
readonly
Returns the value of attribute raw_args.
-
#raw_options ⇒ Object
readonly
Returns the value of attribute raw_options.
-
#raw_path ⇒ Object
readonly
Returns the value of attribute raw_path.
Instance Method Summary collapse
- #args ⇒ Object
-
#initialize(path:, args: {}, options: {}) ⇒ Request
constructor
A new instance of Request.
- #options ⇒ Object
- #path ⇒ Object
- #server ⇒ Object
- #verb ⇒ Object
Constructor Details
#initialize(path:, args: {}, options: {}) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 |
# File 'lib/comic_vine/api/request.rb', line 8 def initialize(path:, args: {}, options: {}) @raw_path = path @raw_args = args @raw_options = end |
Instance Attribute Details
#raw_args ⇒ Object (readonly)
Returns the value of attribute raw_args.
4 5 6 |
# File 'lib/comic_vine/api/request.rb', line 4 def raw_args @raw_args end |
#raw_options ⇒ Object (readonly)
Returns the value of attribute raw_options.
4 5 6 |
# File 'lib/comic_vine/api/request.rb', line 4 def @raw_options end |
#raw_path ⇒ Object (readonly)
Returns the value of attribute raw_path.
4 5 6 |
# File 'lib/comic_vine/api/request.rb', line 4 def raw_path @raw_path end |
Instance Method Details
#args ⇒ Object
22 23 24 25 26 |
# File 'lib/comic_vine/api/request.rb', line 22 def args { format: :json }.merge(raw_args) end |
#options ⇒ Object
28 29 30 |
# File 'lib/comic_vine/api/request.rb', line 28 def end |
#path ⇒ Object
18 19 20 |
# File 'lib/comic_vine/api/request.rb', line 18 def path "/api/#{raw_path}/" end |
#server ⇒ Object
32 33 34 |
# File 'lib/comic_vine/api/request.rb', line 32 def server ComicVine::Api::DEFAULT_SERVER end |
#verb ⇒ Object
14 15 16 |
# File 'lib/comic_vine/api/request.rb', line 14 def verb GET end |