Class: RedboothRuby::Client
- Inherits:
-
Object
- Object
- RedboothRuby::Client
- Defined in:
- lib/redbooth-ruby/client.rb
Constant Summary collapse
- RESOURCES =
[ :me, :user, :task, :organization, :person, :project, :conversation, :membership, :comment, :note, :subtask, :file, :task_list ]
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(session, options = {}) ⇒ Client
constructor
Creates an client object using the given Redbooth session.
-
#resource ⇒ Object
Metaprograming of every resource to execute it over the perform! method just to add session tho the resource.
Methods included from Helpers
Methods included from RedboothRuby::ClientOperations::Metadata
Methods included from RedboothRuby::ClientOperations::Search
Constructor Details
#initialize(session, options = {}) ⇒ Client
Creates an client object using the given Redbooth session. existing account.
19 20 21 22 23 24 |
# File 'lib/redbooth-ruby/client.rb', line 19 def initialize(session, ={}) raise RedboothRuby::AuthenticationError unless session.valid? @session = session @options = self end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/redbooth-ruby/client.rb', line 11 def @options end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
11 12 13 |
# File 'lib/redbooth-ruby/client.rb', line 11 def session @session end |
Instance Method Details
#resource ⇒ Object
Metaprograming of every resource to execute it over the perform! method just to add session tho the resource
39 40 41 42 43 44 45 |
# File 'lib/redbooth-ruby/client.rb', line 39 RESOURCES.each do |resource| eval %{ def #{resource.to_s}(action, options={}) perform!(:#{resource.to_s}, action, options) end } end |