Class: Fleakr::Objects::Comment

Inherits:
Object
  • Object
show all
Includes:
Support::Object
Defined in:
lib/fleakr/objects/comment.rb

Overview

Comment

This class represents a comment that can be associated with a single photo or an entire photoset.

Attributes

id

The unique identifier for this comment

url

The direct URL / permalink to reference this comment

body

The comment itself - also available with to_s

Instance Method Summary collapse

Methods included from Support::Object

included

Instance Method Details

#authorObject

The user who supplied the comment. See Fleakr::Objects::User for more information



30
31
32
# File 'lib/fleakr/objects/comment.rb', line 30

def author
  @author ||= User.find_by_id(author_id)
end

#created_atObject

When was this comment created?



36
37
38
# File 'lib/fleakr/objects/comment.rb', line 36

def created_at
  Time.at(created.to_i)
end

#to_sObject

The contents of the comment - also available as body



42
43
44
# File 'lib/fleakr/objects/comment.rb', line 42

def to_s
  body
end