Class: Flattr::Client
- Inherits:
-
Object
- Object
- Flattr::Client
- Includes:
- Authenticatable, Categories, Flattrs, Languages, Things, Users, Connection, OAuth2, Request
- Defined in:
- lib/flattr/client.rb,
lib/flattr/client/users.rb,
lib/flattr/client/things.rb,
lib/flattr/client/flattrs.rb,
lib/flattr/client/languages.rb,
lib/flattr/client/categories.rb
Defined Under Namespace
Modules: Categories, Flattrs, Languages, Things, Users
Class Method Summary collapse
Instance Method Summary collapse
-
#current_user ⇒ Flattr::User
Returns the configured name or the name of the authenticated user.
-
#initialize(attrs = {}) ⇒ Flattr::Client
constructor
Initializes a new API object.
Methods included from Flattrs
Methods included from Categories
Methods included from Languages
Methods included from Things
#thing, #thing_delete, #thing_flattrs, #thing_lookup, #thing_new, #thing_search, #thing_update, #things
Methods included from Users
#user, #user_flattrs, #user_things
Methods included from OAuth2
#authorize_url, #get_access_token
Methods included from Authenticatable
Methods included from Request
#delete, #get, #patch, #post, #put
Constructor Details
#initialize(attrs = {}) ⇒ Flattr::Client
Initializes a new API object
39 40 41 42 43 44 |
# File 'lib/flattr/client.rb', line 39 def initialize(attrs={}) attrs = Flattr..merge(attrs) Config::VALID_OPTIONS_KEYS.each do |key| instance_variable_set("@#{key}".to_sym, attrs[key]) end end |
Class Method Details
.base64_encode(str) ⇒ Object
53 54 55 |
# File 'lib/flattr/client.rb', line 53 def self.base64_encode str [str].pack("m9999").chomp end |
Instance Method Details
#current_user ⇒ Flattr::User
Returns the configured name or the name of the authenticated user
49 50 51 |
# File 'lib/flattr/client.rb', line 49 def current_user @current_user ||= self.user end |