Class: Xing::Comment

Inherits:
Base
  • Object
show all
Defined in:
lib/xing/comment.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize, lazy_attr_reader

Constructor Details

This class inherits a constructor from Xing::Base

Instance Method Details

#posted_atObject

Returns Time.

Returns:

  • Time



6
7
8
# File 'lib/xing/comment.rb', line 6

def posted_at
  @posted_at ||=  Time.parse(@attrs['created_at']).utc unless @attrs['created_at'].nil?
end

#userObject

Returns Xing::User.

Returns:

  • Xing::User



11
12
13
# File 'lib/xing/comment.rb', line 11

def user
  @user ||= Xing::User.new(@attrs.dup['creator']) unless @attrs["creator"].nil?
end