Class: Sinew::Main
Instance Attribute Summary collapse
-
#runtime_options ⇒ Object
readonly
Returns the value of attribute runtime_options.
Instance Method Summary collapse
- #dsl ⇒ Object
-
#http(method, url, options = {}) ⇒ Object
http requests.
-
#initialize(options) ⇒ Main
constructor
A new instance of Main.
-
#output ⇒ Object
output.
- #quiet? ⇒ Boolean
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Main
Returns a new instance of Main.
12 13 14 15 16 17 |
# File 'lib/sinew/main.rb', line 12 def initialize() super() # init @runtime_options = RuntimeOptions.new end |
Instance Attribute Details
#runtime_options ⇒ Object (readonly)
Returns the value of attribute runtime_options.
10 11 12 |
# File 'lib/sinew/main.rb', line 10 def @runtime_options end |
Instance Method Details
#http(method, url, options = {}) ⇒ Object
http requests
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/sinew/main.rb', line 36 def http(method, url, = {}) request = Request.new(self, method, url, ) response = request.perform(connection) # always log error messages if response.error? puts "xxx http request failed with #{response.code}" end response end |
#output ⇒ Object
output
57 58 59 |
# File 'lib/sinew/main.rb', line 57 def output @output ||= Output.new(self) end |
#quiet? ⇒ Boolean
24 25 26 |
# File 'lib/sinew/main.rb', line 24 def quiet? [:quiet] end |
#run ⇒ Object
19 20 21 22 |
# File 'lib/sinew/main.rb', line 19 def run dsl.run if !quiet? end |