lib/pixela/graph.rb in pixela-1.0.0 vs lib/pixela/graph.rb in pixela-1.0.1

- old
+ new

@@ -22,26 +22,27 @@ Pixel.new(client: client, graph_id: graph_id, date: date) end # Create a new pixelation graph definition. # - # @param name [String] - # @param unit [String] - # @param type [String] - # @param color [String] - # @param timezone [String] + # @param name [String] + # @param unit [String] + # @param type [String] + # @param color [String] + # @param timezone [String] + # @param self_sufficient [String] If SVG graph with this field `increment` or `decrement` is referenced, Pixel of this graph itself will be incremented or decremented # # @return [Pixela::Response] # # @raise [Pixela::PixelaError] API is failed # # @see https://docs.pixe.la/#/post-graph # # @example - # client.graph("test-graph").create(name: "graph-name", unit: "commit", type: "int", color: "shibafu", timezone: "Asia/Tokyo") - def create(name:, unit:, type:, color:, timezone: nil) - client.create_graph(graph_id: graph_id, name: name, unit: unit, type: type, color: color, timezone: timezone) + # client.graph("test-graph").create(name: "graph-name", unit: "commit", type: "int", color: "shibafu", timezone: "Asia/Tokyo", self_sufficient: "increment") + def create(name:, unit:, type:, color:, timezone: nil, self_sufficient: nil) + client.create_graph(graph_id: graph_id, name: name, unit: unit, type: type, color: color, timezone: timezone, self_sufficient: self_sufficient) end # Get graph url # # @param date [Date,Time] @@ -62,21 +63,22 @@ # # @param name [String] # @param unit [String] # @param color [String] # @param timezone [String] + # @param self_sufficient [String] If SVG graph with this field `increment` or `decrement` is referenced, Pixel of this graph itself will be incremented or decremented # @param purge_cache_urls [String,Array<String>] # # @return [Pixela::Response] # # @raise [Pixela::PixelaError] API is failed # # @see https://docs.pixe.la/#/put-graph # # @example # client.graph("test-graph").update(name: "graph-name", unit: "commit", color: "shibafu", timezone: "Asia/Tokyo", purge_cache_urls: ["https://camo.githubusercontent.com/xxx/xxxx"]) - def update(name: nil, unit: nil, color: nil, timezone: nil, purge_cache_urls: nil) - client.update_graph(graph_id: graph_id, name: name, unit: unit, color: color, timezone: timezone, purge_cache_urls: purge_cache_urls) + def update(name: nil, unit: nil, color: nil, timezone: nil, purge_cache_urls: nil, self_sufficient: nil) + client.update_graph(graph_id: graph_id, name: name, unit: unit, color: color, timezone: timezone, self_sufficient: self_sufficient, purge_cache_urls: purge_cache_urls) end # Delete the predefined pixelation graph definition. # # @return [Pixela::Response]