Class: Rumblr::Post

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

Overview

for attribute details, see Tumblr’s documentation: www.tumblr.com/api

Constant Summary collapse

TYPES =
{
  'regular'      => "RegularPost",
  'photo'        => "PhotoPost",
  'quote'        => "QuotePost",
  'link'         => "LinkPost",
  'conversation' => "ConversationPost",
  'video'        => "VideoPost",
  'audio'        => "AudioPost"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Post

Returns a new instance of Post.



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

def initialize(attrs={})
  @private = false
  super
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



17
18
19
# File 'lib/rumblr/post.rb', line 17

def date
  @date
end

#date_gmtObject (readonly)

Returns the value of attribute date_gmt.



17
18
19
# File 'lib/rumblr/post.rb', line 17

def date_gmt
  @date_gmt
end

#idObject (readonly)

Returns the value of attribute id.



17
18
19
# File 'lib/rumblr/post.rb', line 17

def id
  @id
end

#privateObject (readonly)

Returns the value of attribute private.



17
18
19
# File 'lib/rumblr/post.rb', line 17

def private
  @private
end

#tagsObject (readonly)

Returns the value of attribute tags.



17
18
19
# File 'lib/rumblr/post.rb', line 17

def tags
  @tags
end

#tumblelogObject

Returns the value of attribute tumblelog.



18
19
20
# File 'lib/rumblr/post.rb', line 18

def tumblelog
  @tumblelog
end

#typeObject (readonly)

Returns the value of attribute type.



17
18
19
# File 'lib/rumblr/post.rb', line 17

def type
  @type
end

#unix_timestampObject (readonly)

Returns the value of attribute unix_timestamp.



17
18
19
# File 'lib/rumblr/post.rb', line 17

def unix_timestamp
  @unix_timestamp
end

#urlObject (readonly)

Returns the value of attribute url.



17
18
19
# File 'lib/rumblr/post.rb', line 17

def url
  @url
end

Instance Method Details

#attribute_hashObject



33
34
35
# File 'lib/rumblr/post.rb', line 33

def attribute_hash
  {:date => date}
end

#private?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rumblr/post.rb', line 25

def private?
  @private
end

#public?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rumblr/post.rb', line 29

def public?
  !self.private?
end