Class: Rumblr::Tumblelog

Inherits:
Resource show all
Defined in:
lib/rumblr/tumblelog.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Rumblr::Resource

Instance Attribute Details

#avatar_urlObject (readonly)

Returns the value of attribute avatar_url.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def avatar_url
  @avatar_url
end

#cnameObject (readonly)

Returns the value of attribute cname.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def cname
  @cname
end

#is_primaryObject (readonly)

Returns the value of attribute is_primary.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def is_primary
  @is_primary
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def name
  @name
end

#private_idObject (readonly)

Returns the value of attribute private_id.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def private_id
  @private_id
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def timezone
  @timezone
end

#titleObject (readonly)

Returns the value of attribute title.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url.



4
5
6
# File 'lib/rumblr/tumblelog.rb', line 4

def url
  @url
end

#userObject

Returns the value of attribute user.



6
7
8
# File 'lib/rumblr/tumblelog.rb', line 6

def user
  @user
end

Class Method Details

.find_by_url(url) ⇒ Object



20
21
22
23
# File 'lib/rumblr/tumblelog.rb', line 20

def find_by_url(url)
  log, posts = Client.instance.read(:url => url)
  return log
end

Instance Method Details

#postsObject



8
9
10
11
12
# File 'lib/rumblr/tumblelog.rb', line 8

def posts
  return [] unless self.url
  log, posts = Client.instance.read({:url => self.url}.merge(self.user.auth))
  return posts
end

#primary?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rumblr/tumblelog.rb', line 14

def primary?
  is_primary == "yes"
end