Class: RendertronRuby::Client
- Inherits:
-
Object
- Object
- RendertronRuby::Client
- Includes:
- Connection, Request
- Defined in:
- lib/rendertron_ruby/client.rb
Constant Summary collapse
- DEFAULT_HOST =
'localhost:3000'.freeze
- DEFAULT_SCHEME =
'https'.freeze
- DEFAULT_RENDER_PATH =
'/render'.freeze
- DEFAULT_SS_PATH =
'/screenshot'.freeze
Instance Method Summary collapse
- #get(url) ⇒ Object
- #get_ss(url) ⇒ Object
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
Methods included from Request
Methods included from Connection
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
16 17 18 19 20 21 |
# File 'lib/rendertron_ruby/client.rb', line 16 def initialize() @host = [:host] || default_host @scheme = [:scheme] || default_scheme @render_path = [:render_path] || default_render_path @ss_path = [:ss_path] || default_ss_path end |
Instance Method Details
#get(url) ⇒ Object
23 24 25 |
# File 'lib/rendertron_ruby/client.rb', line 23 def get(url) request(:get, "#{render_path}/#{url}") end |
#get_ss(url) ⇒ Object
27 28 29 |
# File 'lib/rendertron_ruby/client.rb', line 27 def get_ss(url) request(:get, "#{ss_path}/#{url}") end |