Class: Fourchan::Kit::Post
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Fourchan::Kit::Post
- Defined in:
- lib/fourchan/kit/post.rb
Overview
Post should make it easy to use OpenStruct for posts in a thread.
Also make it possible to get the link for the image, if the post has one.
Instance Method Summary (collapse)
-
- (URL) image_link
Return an URL for the image (if user submitted an image).
-
- (Post) initialize(hash, board)
constructor
A new instance of Post.
Constructor Details
- (Post) initialize(hash, board)
Returns a new instance of Post
10 11 12 13 |
# File 'lib/fourchan/kit/post.rb', line 10 def initialize(hash, board) super(hash) @board = board end |
Instance Method Details
- (URL) image_link
Return an URL for the image (if user submitted an image).
19 20 21 |
# File 'lib/fourchan/kit/post.rb', line 19 def image_link "http://i.4cdn.org/#{@board}/#{self.tim}#{self.ext}" if self.tim end |