Class: Disqus::Post
- Inherits:
-
Object
- Object
- Disqus::Post
- Defined in:
- lib/acts_as_disqusable/post.rb
Instance Attribute Summary collapse
-
#anonymous_author ⇒ Object
Returns the value of attribute anonymous_author.
-
#author ⇒ Object
Returns the value of attribute author.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#forum ⇒ Object
Returns the value of attribute forum.
-
#has_been_moderated ⇒ Object
Returns the value of attribute has_been_moderated.
-
#id ⇒ Object
Returns the value of attribute id.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#is_anonymous ⇒ Object
Returns the value of attribute is_anonymous.
-
#message ⇒ Object
Returns the value of attribute message.
-
#parent_post ⇒ Object
Returns the value of attribute parent_post.
-
#points ⇒ Object
Returns the value of attribute points.
-
#shown ⇒ Object
Returns the value of attribute shown.
-
#status ⇒ Object
Returns the value of attribute status.
-
#thread ⇒ Object
Returns the value of attribute thread.
Class Method Summary collapse
Instance Method Summary collapse
- #author_name ⇒ Object
-
#initialize(data) ⇒ Post
constructor
A new instance of Post.
- #linked_author(opts = {}) ⇒ Object
Constructor Details
#initialize(data) ⇒ Post
Returns a new instance of Post.
4 5 6 |
# File 'lib/acts_as_disqusable/post.rb', line 4 def initialize(data) data.each { |k, v| send(:"#{k}=", v) } end |
Instance Attribute Details
#anonymous_author ⇒ Object
Returns the value of attribute anonymous_author.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def @anonymous_author end |
#author ⇒ Object
Returns the value of attribute author.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def @author end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def created_at @created_at end |
#forum ⇒ Object
Returns the value of attribute forum.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def forum @forum end |
#has_been_moderated ⇒ Object
Returns the value of attribute has_been_moderated.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def has_been_moderated @has_been_moderated end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def id @id end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def ip_address @ip_address end |
#is_anonymous ⇒ Object
Returns the value of attribute is_anonymous.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def is_anonymous @is_anonymous end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def @message end |
#parent_post ⇒ Object
Returns the value of attribute parent_post.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def parent_post @parent_post end |
#points ⇒ Object
Returns the value of attribute points.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def points @points end |
#shown ⇒ Object
Returns the value of attribute shown.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def shown @shown end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def status @status end |
#thread ⇒ Object
Returns the value of attribute thread.
3 4 5 |
# File 'lib/acts_as_disqusable/post.rb', line 3 def thread @thread end |
Class Method Details
Instance Method Details
#author_name ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/acts_as_disqusable/post.rb', line 8 def if is_anonymous ["name"] else ["display_name"] || ["username"] end end |
#linked_author(opts = {}) ⇒ Object
16 17 18 |
# File 'lib/acts_as_disqusable/post.rb', line 16 def (opts={}) "<a href=\"#{['url']}\" target=\"#{opts[:target]}\" class=\"#{opts[:class]}\">#{self.}</a>" end |