Class: Tumblr::Client
- Inherits:
-
Object
- Object
- Tumblr::Client
- Defined in:
- lib/tumblr/client.rb
Constant Summary
Constants included from Post
Post::DATA_POST_TYPES, Post::STANDARD_POST_OPTIONS, Post::VALID_POST_TYPES
Class Method Summary collapse
Instance Method Summary collapse
- #api_host ⇒ Object
- #api_scheme ⇒ Object
- #credentials ⇒ Object
-
#initialize(attrs = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Connection
Methods included from Tagged
Methods included from Post
#audio, #chat, #create_post, #delete, #edit, #link, #photo, #quote, #reblog, #text, #video
Methods included from User
#dashboard, #follow, #following, #info, #like, #likes, #unfollow, #unlike
Methods included from Blog
#avatar, #blog_info, #blog_likes, #draft, #followers, #posts, #queue, #submissions
Methods included from Request
#get, #get_redirect_url, #get_response, #post, #respond
Constructor Details
#initialize(attrs = {}) ⇒ Client
Returns a new instance of Client.
26 27 28 29 30 31 |
# File 'lib/tumblr/client.rb', line 26 def initialize(attrs= {}) attrs = Tumblr..merge(attrs) Config::VALID_OPTIONS_KEYS.each do |key| instance_variable_set("@#{key}".to_sym, attrs[key]) end end |
Class Method Details
.default_api_host ⇒ Object
13 14 15 |
# File 'lib/tumblr/client.rb', line 13 def default_api_host ENV['TUMBLR_API_HOST'] || 'api.tumblr.com' end |
Instance Method Details
#api_host ⇒ Object
33 34 35 |
# File 'lib/tumblr/client.rb', line 33 def api_host self.class.default_api_host end |
#api_scheme ⇒ Object
37 38 39 |
# File 'lib/tumblr/client.rb', line 37 def api_scheme @api_scheme || 'https' end |
#credentials ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/tumblr/client.rb', line 41 def credentials { :consumer_key => @consumer_key, :consumer_secret => @consumer_secret, :token => @oauth_token, :token_secret => @oauth_token_secret } end |