Class: Kagerator::Request
- Inherits:
-
Object
- Object
- Kagerator::Request
- Defined in:
- lib/kagerator/request.rb
Class Method Summary collapse
Instance Method Summary collapse
- #execute(&block) ⇒ Object
-
#initialize(args) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(args) ⇒ Request
Returns a new instance of Request.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/kagerator/request.rb', line 13 def initialize args @method = args[:method] or raise ArgumentError, "must pass :method" @headers = args[:headers] || {} if args[:url] @url = args[:url] else raise ArgumentError, "must pass :url" end @args = args end |
Class Method Details
.execute(args, &block) ⇒ Object
9 10 11 |
# File 'lib/kagerator/request.rb', line 9 def self.execute(args, &block) new(args).execute(&block) end |