Class: Tumblr4r::Post

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

Overview

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

Direct Known Subclasses

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.



179
180
181
182
# File 'lib/tumblr4r.rb', line 179

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

Instance Attribute Details

#bookmarkletObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def bookmarklet
  @bookmarklet
end

#dateObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def date
  @date
end

#date_gmtObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def date_gmt
  @date_gmt
end

#formatObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def format
  @format
end

#generatorObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def generator
  @generator
end

#post_idObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def post_id
  @post_id
end

#privateObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def private
  @private
end

#tagsObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def tags
  @tags
end

#typeObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def type
  @type
end

#unix_timestampObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def unix_timestamp
  @unix_timestamp
end

#urlObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def url
  @url
end

#url_with_slugObject

Integer



163
164
165
# File 'lib/tumblr4r.rb', line 163

def url_with_slug
  @url_with_slug
end

Instance Method Details

#paramsObject



184
185
186
187
188
189
190
191
192
# File 'lib/tumblr4r.rb', line 184

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