Class: Geckoboard::Dataset
- Inherits:
-
Object
- Object
- Geckoboard::Dataset
- Defined in:
- lib/geckoboard/dataset.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(client, id, fields) ⇒ Dataset
constructor
A new instance of Dataset.
- #post(data, options = {}) ⇒ Object
- #put(data) ⇒ Object
Constructor Details
#initialize(client, id, fields) ⇒ Dataset
Returns a new instance of Dataset.
5 6 7 8 9 |
# File 'lib/geckoboard/dataset.rb', line 5 def initialize(client, id, fields) @client = client @id = id @fields = fields end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/geckoboard/dataset.rb', line 3 def client @client end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
3 4 5 |
# File 'lib/geckoboard/dataset.rb', line 3 def fields @fields end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/geckoboard/dataset.rb', line 3 def id @id end |
Instance Method Details
#delete ⇒ Object
11 12 13 |
# File 'lib/geckoboard/dataset.rb', line 11 def delete client.delete(id) end |
#post(data, options = {}) ⇒ Object
19 20 21 |
# File 'lib/geckoboard/dataset.rb', line 19 def post(data, = {}) client.post_data(id, payload_formatter.format(data), ) end |
#put(data) ⇒ Object
15 16 17 |
# File 'lib/geckoboard/dataset.rb', line 15 def put(data) client.put_data(id, payload_formatter.format(data)) end |