Class: Demio::Client
- Inherits:
-
Object
- Object
- Demio::Client
- Includes:
- Event, EventDate, Events, Participants, Register
- Defined in:
- lib/demio/event.rb,
lib/demio/client.rb,
lib/demio/events.rb,
lib/demio/register.rb,
lib/demio/event_date.rb,
lib/demio/participants.rb
Defined Under Namespace
Modules: Event, EventDate, Events, Participants, Register
Constant Summary collapse
- REQUEST_REDIRECT_FOLLOW_LIMIT =
10
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
readonly
Returns the value of attribute api_secret.
Instance Method Summary collapse
- #get(uri) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #ping ⇒ Object
- #put(uri, payload) ⇒ Object
Methods included from Register
Methods included from Participants
Methods included from Events
Methods included from EventDate
Methods included from Event
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
25 26 27 28 |
# File 'lib/demio/client.rb', line 25 def initialize( = {}) @api_key = [:api_key] @api_secret = [:api_secret] end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
21 22 23 |
# File 'lib/demio/client.rb', line 21 def api_key @api_key end |
#api_secret ⇒ Object (readonly)
Returns the value of attribute api_secret.
21 22 23 |
# File 'lib/demio/client.rb', line 21 def api_secret @api_secret end |
Instance Method Details
#get(uri) ⇒ Object
30 31 32 |
# File 'lib/demio/client.rb', line 30 def get(uri) make_request(Net::HTTP::Get, uri) end |
#ping ⇒ Object
38 39 40 41 42 43 |
# File 'lib/demio/client.rb', line 38 def ping make_request( Net::HTTP::Get, "ping/query?api_key=#{api_key}&api_secret=#{api_secret}" ) end |
#put(uri, payload) ⇒ Object
34 35 36 |
# File 'lib/demio/client.rb', line 34 def put(uri, payload) make_request(Net::HTTP::Put, uri, payload) end |