Class: PostmonRuby::Http
- Inherits:
-
Object
- Object
- PostmonRuby::Http
- Defined in:
- lib/postmon_ruby/http/http.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.get(uri) ⇒ Object
4 5 6 7 8 |
# File 'lib/postmon_ruby/http/http.rb', line 4 def self.get(uri) instance = PostmonRuby::Http.new instance.instance_variable_set("@response", Net::HTTP.get_response(uri)) instance end |
Instance Method Details
#[](key) ⇒ Object
10 11 12 13 |
# File 'lib/postmon_ruby/http/http.rb', line 10 def [](key) @json = json unless @json @json[key] end |
#not_found? ⇒ Boolean
15 16 17 |
# File 'lib/postmon_ruby/http/http.rb', line 15 def not_found? @response.is_a?(Net::HTTPNotFound) end |