Sha256: 912001856d43e6ac787804b97cc357c17de6d37abb3a4fd16d060fe027516a38

Contents?: true

Size: 726 Bytes

Versions: 1

Compression:

Stored size: 726 Bytes

Contents

module Flickry
  class Comment < Flickry::Base
    def initialize(comment)
      super(nil)
      extract_attrs!(comment, [:fid, :authorname, :datecreate, :permalink])
      self.content = comment.to_s
      self.author_id = comment.author
    end
    
    def comment_id
      self.fid
    end
    
    def to_s
      self.content
    end
    
    # Clean permalink
    def to_url
      clean(self.permalink)
    end
    
    # datecreate converted into Time object
    def created_at
      Time.at(self.datecreate.to_i)
    end
    
    # Get a Person record for the author_id
    def author
      Flickry::Person.find(self.author_id)
    end
    
    # name = authornane
    def name
      self.authorname
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wideopenspaces-flickry-0.1.5 lib/flickry/comment.rb