Class: Rest::Get
Instance Method Summary collapse
- #[](params = {}) ⇒ Object
-
#initialize(url, params = {}) ⇒ Get
constructor
A new instance of Get.
Constructor Details
#initialize(url, params = {}) ⇒ Get
Returns a new instance of Get.
26 27 28 29 30 |
# File 'lib/sh_util.rb', line 26 def initialize(url, params={}) @url = url.dup @query = '' @query = build_query params end |
Instance Method Details
#[](params = {}) ⇒ Object
32 33 34 35 |
# File 'lib/sh_util.rb', line 32 def [](params={}) query = build_query params open(@url + query).read end |