Class: ReqWrap::Generator::Req
- Inherits:
-
Object
- Object
- ReqWrap::Generator::Req
- Defined in:
- lib/req_wrap/generator/req.rb
Constant Summary collapse
- TEMPLATE =
"#{File.dirname(__FILE__)}/req.erb".freeze
- RUBY_EXT =
'.rb'
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(request_file, options = {}) ⇒ Req
constructor
A new instance of Req.
Constructor Details
#initialize(request_file, options = {}) ⇒ Req
Returns a new instance of Req.
15 16 17 18 19 20 |
# File 'lib/req_wrap/generator/req.rb', line 15 def initialize(request_file, = {}) @request_file = ensure_extension(request_file, RUBY_EXT) @request_name = File.basename(@request_file, RUBY_EXT) @options = end |
Instance Method Details
#call ⇒ Object
22 23 24 25 26 27 |
# File 'lib/req_wrap/generator/req.rb', line 22 def call File.write( @request_file, template.result_with_hash() ) end |