Class: Pixela::Client
- Inherits:
-
Object
- Object
- Pixela::Client
- Includes:
- GraphMethods, PixelMethods, UserMethods
- Defined in:
- lib/pixela/client.rb
Defined Under Namespace
Modules: GraphMethods, PixelMethods, UserMethods
Constant Summary collapse
- API_ENDPOINT =
"https://pixe.la/v1"
Instance Attribute Summary collapse
- #username ⇒ String readonly
Instance Method Summary collapse
- #graph(graph_id) ⇒ Pixela::Graph
-
#initialize(username:, token:) ⇒ Client
constructor
A new instance of Client.
- #inspect ⇒ String
Methods included from UserMethods
#create_user, #delete_user, #update_user
Methods included from PixelMethods
#create_pixel, #decrement_pixel, #delete_pixel, #get_pixel, #increment_pixel, #update_pixel
Methods included from GraphMethods
#create_graph, #delete_graph, #get_graphs, #graph_url, #update_graph
Constructor Details
#initialize(username:, token:) ⇒ Client
Returns a new instance of Client.
19 20 21 22 |
# File 'lib/pixela/client.rb', line 19 def initialize(username:, token:) @username = username @token = token end |
Instance Attribute Details
#username ⇒ String (readonly)
15 16 17 |
# File 'lib/pixela/client.rb', line 15 def username @username end |
Instance Method Details
#graph(graph_id) ⇒ Pixela::Graph
33 34 35 |
# File 'lib/pixela/client.rb', line 33 def graph(graph_id) Graph.new(client: self, graph_id: graph_id) end |
#inspect ⇒ String
25 26 27 28 |
# File 'lib/pixela/client.rb', line 25 def inspect # NOTE: hide @token %Q(#<Pixela::Client:0x#{"%016X" % object_id} @username="#{username}">) end |