lib/pixela/graph.rb in pixela-0.5.0 vs lib/pixela/graph.rb in pixela-0.5.1

- old
+ new

@@ -31,11 +31,11 @@ # # @return [Hashie::Mash] # # @raise [Pixela::PixelaError] API is failed # - # @see https://pixe.la/#api-graph + # @see https://pixe.la/#api-detail-post-graphs # # @example # client.graph("test-graph").create(name: "graph-name", unit: "commit", type: "int", color: "shibafu") def create(name:, unit:, type:, color:) client.create_graph(graph_id: graph_id, name: name, unit: unit, type: type, color: color) @@ -46,11 +46,11 @@ # @param date [Date,Time] # @param mode [String] e.g) `short` # # @return [String] # - # @see https://pixe.la/#api-graph + # @see https://pixe.la/#api-detail-get-graph # # @example # client.graph("test-graph").url # client.graph("test-graph").url(date: Date.new(2018, 3, 31), mode: "short") def url(date: nil, mode: nil) @@ -66,25 +66,39 @@ # # @return [Hashie::Mash] # # @raise [Pixela::PixelaError] API is failed # - # @see https://pixe.la/#api-graph + # @see https://pixe.la/#api-detail-put-graph # # @example # client.graph("test-graph").update(name: "graph-name", unit: "commit", color: "shibafu", purge_cache_urls: ["https://camo.githubusercontent.com/xxx/xxxx"]) - def update(name:, unit:, color:, purge_cache_urls: nil) + def update(name: nil, unit: nil, color: nil, purge_cache_urls: nil) client.update_graph(graph_id: graph_id, name: name, unit: unit, color: color, purge_cache_urls: purge_cache_urls) end + # Delete the predefined pixelation graph definition. + # + # @return [Hashie::Mash] + # + # @raise [Pixela::PixelaError] API is failed + # + # @see https://pixe.la/#api-detail-put-graph + # + # @example + # client.graph("test-graph").delete + def delete + client.delete_graph(graph_id) + end + # Increment quantity "Pixel" of the day (UTC). # # @return [Hashie::Mash] # # @raise [Pixela::PixelaError] API is failed # - # @see https://pixe.la/#api-pixel + # @see https://pixe.la/#api-detail-pixel-increment # # @example # client.graph("test-graph").increment def increment client.increment_pixel(graph_id: graph_id) @@ -94,10 +108,10 @@ # # @return [Hashie::Mash] # # @raise [Pixela::PixelaError] API is failed # - # @see https://pixe.la/#api-pixel + # @see https://pixe.la/#api-detail-pixel-decrement # # @example # client.graph("test-graph").decrement def decrement client.decrement_pixel(graph_id: graph_id)