Class: Pixela::Pixel
- Inherits:
-
Object
- Object
- Pixela::Pixel
- Defined in:
- lib/pixela/pixel.rb
Instance Attribute Summary collapse
- #client ⇒ Pixela::Client readonly
- #date ⇒ Date readonly
- #graph_id ⇒ String readonly
Instance Method Summary collapse
-
#create(quantity:) ⇒ Hashie::Mash
It records the quantity of the specified date as a "Pixel".
-
#delete ⇒ Hashie::Mash
Delete the registered "Pixel".
-
#get ⇒ Hashie::Mash
Get registered quantity as "Pixel".
-
#initialize(client:, graph_id:, date:) ⇒ Pixel
constructor
A new instance of Pixel.
-
#update(quantity:) ⇒ Hashie::Mash
Update the quantity already registered as a "Pixel".
Constructor Details
#initialize(client:, graph_id:, date:) ⇒ Pixel
Returns a new instance of Pixel.
18 19 20 21 22 |
# File 'lib/pixela/pixel.rb', line 18 def initialize(client:, graph_id:, date:) @client = client @graph_id = graph_id @date = date end |
Instance Attribute Details
#client ⇒ Pixela::Client (readonly)
5 6 7 |
# File 'lib/pixela/pixel.rb', line 5 def client @client end |
#date ⇒ Date (readonly)
13 14 15 |
# File 'lib/pixela/pixel.rb', line 13 def date @date end |
#graph_id ⇒ String (readonly)
9 10 11 |
# File 'lib/pixela/pixel.rb', line 9 def graph_id @graph_id end |
Instance Method Details
#create(quantity:) ⇒ Hashie::Mash
It records the quantity of the specified date as a "Pixel".
36 37 38 |
# File 'lib/pixela/pixel.rb', line 36 def create(quantity:) client.create_pixel(graph_id: graph_id, date: date, quantity: quantity) end |
#delete ⇒ Hashie::Mash
Delete the registered "Pixel".
80 81 82 |
# File 'lib/pixela/pixel.rb', line 80 def delete client.delete_pixel(graph_id: graph_id, date: date) end |
#get ⇒ Hashie::Mash
Get registered quantity as "Pixel".
50 51 52 |
# File 'lib/pixela/pixel.rb', line 50 def get client.get_pixel(graph_id: graph_id, date: date) end |
#update(quantity:) ⇒ Hashie::Mash
Update the quantity already registered as a "Pixel".
66 67 68 |
# File 'lib/pixela/pixel.rb', line 66 def update(quantity:) client.update_pixel(graph_id: graph_id, date: date, quantity: quantity) end |