-
Notifications
You must be signed in to change notification settings - Fork 1
pixe.la API methods
These methods are written in application_controller.rb
. They can be called in any controllers.
This method returns the serialized svg file of the activity graph of a current user.
If the activity graph of the user hasn't been created, this method calls create_graph
method to create a graph and returns the one created by the method.
In a controller,
@result = get_graph
and in a view,
<%= @result.html_safe %>
controllers/users/registrations_controller.rb
and views/devise/registrations/edit.html.erb
.
If the activity graph of the user hasn't been created, this method create a graph of the user.
A pixel is the smallest unit of pixe.la's graphs. A pixel represents user's activity of a day.
This method calls update_pixel
method or create_pixel
method depending on the situation.
This method creates a new pixel of the given date.
This method increments the quantity of the pixel of the given date.
This method read the quantity of the pixel of the given date.