Class: TumblrWrapper::BlogResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/tumblr_wrapper/resources/blog_resource.rb

Direct Known Subclasses

Blog, Post

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HTTP

#http_get, #http_post

Methods included from Validators

#validate_not_present, #validate_oauth, #validate_present

Constructor Details

#initialize(base_hostname, access_token = nil) ⇒ BlogResource

Returns a new instance of BlogResource.


4
5
6
7
# File 'lib/tumblr_wrapper/resources/blog_resource.rb', line 4

def initialize(base_hostname, access_token=nil)
  @hostname = base_hostname
  super(access_token)
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token


2
3
4
# File 'lib/tumblr_wrapper/resources/blog_resource.rb', line 2

def access_token
  @access_token
end

#hostnameObject (readonly)

Returns the value of attribute hostname


2
3
4
# File 'lib/tumblr_wrapper/resources/blog_resource.rb', line 2

def hostname
  @hostname
end

Instance Method Details

#blogObject


9
10
11
# File 'lib/tumblr_wrapper/resources/blog_resource.rb', line 9

def blog
  TumblrWrapper::Blog.new(@hostname, access_token)
end

#postObject


13
14
15
# File 'lib/tumblr_wrapper/resources/blog_resource.rb', line 13

def post
  TumblrWrapper::Post.new(@hostname, access_token)
end