Class: Tumblr4r::Post

Inherits:
Object
  • Object
show all
Defined in:
lib/tumblr4r.rb

Overview

Postおよびその子クラスは原則として単なるData Transfer Objectとし、 何かのロジックをこの中に実装はしない。

Direct Known Subclasses

Answer, Audio, Chat, Feed, Link, Photo, Quote, Regular, Video

Constant Summary collapse

@@default_generator =
nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePost

Returns a new instance of Post.



260
261
262
263
# File 'lib/tumblr4r.rb', line 260

def initialize
  @generator = @@default_generator || "Tumblr4R"
  @tags = []
end

Instance Attribute Details

#bookmarkletObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def bookmarklet
  @bookmarklet
end

#dateObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def date
  @date
end

#date_gmtObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def date_gmt
  @date_gmt
end

#formatObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def format
  @format
end

#generatorObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def generator
  @generator
end

#likedObject

Boolean



254
255
256
# File 'lib/tumblr4r.rb', line 254

def liked
  @liked
end

#post_idObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def post_id
  @post_id
end

#privateObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def private
  @private
end

#reblog_keyObject

Boolean



254
255
256
# File 'lib/tumblr4r.rb', line 254

def reblog_key
  @reblog_key
end

#tagsObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def tags
  @tags
end

#typeObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def type
  @type
end

#unix_timestampObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def unix_timestamp
  @unix_timestamp
end

#urlObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def url
  @url
end

#url_with_slugObject

Integer



241
242
243
# File 'lib/tumblr4r.rb', line 241

def url_with_slug
  @url_with_slug
end

Instance Method Details

#paramsObject



265
266
267
268
269
270
271
272
273
# File 'lib/tumblr4r.rb', line 265

def params
  {"type" => @type,
    "generator" => @generator,
    "date" => @date,
    "private" => @private,
    "tags" => @tags.join(","),
    "format" => @format
  }
end