Class: Geckoboard::Dataset

Inherits:
Object
  • Object
show all
Defined in:
lib/geckoboard/dataset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'lib/geckoboard/dataset.rb', line 3

def client
  @client
end

#fieldsObject (readonly)

Returns the value of attribute fields.



3
4
5
# File 'lib/geckoboard/dataset.rb', line 3

def fields
  @fields
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/geckoboard/dataset.rb', line 3

def id
  @id
end

Instance Method Details

#deleteObject



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, options = {})
  client.post_data(id, payload_formatter.format(data), options)
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