Class: JsBinClient::Rest::IndifferentJson
- Inherits:
-
Object
- Object
- JsBinClient::Rest::IndifferentJson
- Defined in:
- lib/jsbin-client/rest.rb
Instance Method Summary collapse
- #[](id) ⇒ Object
-
#initialize(json_string) ⇒ IndifferentJson
constructor
A new instance of IndifferentJson.
- #keys ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(json_string) ⇒ IndifferentJson
Returns a new instance of IndifferentJson.
57 58 59 |
# File 'lib/jsbin-client/rest.rb', line 57 def initialize(json_string) @json = JSON.parse(json_string) end |
Instance Method Details
#[](id) ⇒ Object
61 62 63 |
# File 'lib/jsbin-client/rest.rb', line 61 def [](id) @json[id.to_s] end |
#keys ⇒ Object
65 66 67 |
# File 'lib/jsbin-client/rest.rb', line 65 def keys @json.keys end |
#values ⇒ Object
69 70 71 |
# File 'lib/jsbin-client/rest.rb', line 69 def values @json.values end |