Class: VBulletin::Post

Inherits:
Base
  • Object
show all
Defined in:
lib/vbulletin/post.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#debug, #mechanize, #uri

Instance Method Summary collapse

Methods inherited from Base

#construct_full_url, #construct_url, #forums, #get_index, #login, #search

Constructor Details

#initialize(api, *params) ⇒ Post

Returns a new instance of Post.



6
7
8
9
10
11
# File 'lib/vbulletin/post.rb', line 6

def initialize(api, *params)
  @api = api
  params.each do |key|
    key.each { |k, v| instance_variable_set("@#{k}", v) }
  end
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



4
5
6
# File 'lib/vbulletin/post.rb', line 4

def api
  @api
end

#author_idObject (readonly)

Returns the value of attribute author_id.



4
5
6
# File 'lib/vbulletin/post.rb', line 4

def author_id
  @author_id
end

#author_nameObject (readonly)

Returns the value of attribute author_name.



4
5
6
# File 'lib/vbulletin/post.rb', line 4

def author_name
  @author_name
end

#contentObject (readonly)

Returns the value of attribute content.



4
5
6
# File 'lib/vbulletin/post.rb', line 4

def content
  @content
end

#created_atObject (readonly)

Returns the value of attribute created_at.



4
5
6
# File 'lib/vbulletin/post.rb', line 4

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/vbulletin/post.rb', line 4

def id
  @id
end

Instance Method Details

#threadObject



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

def thread
  @api.search.find_thread_by_post_id(self.id)
end