Class: Xing::Activity
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#link ⇒ Object
String.
-
#link_desc ⇒ Object
String.
- #object ⇒ Object
-
#text ⇒ Object
String.
Methods inherited from Base
#[], #initialize, lazy_attr_reader
Constructor Details
This class inherits a constructor from Xing::Base
Instance Method Details
#link ⇒ Object
Returns String.
6 7 8 |
# File 'lib/xing/activity.rb', line 6 def link @link ||= @attrs["permalink"] unless @attrs["permalink"].nil? end |
#link_desc ⇒ Object
Returns String.
11 12 13 |
# File 'lib/xing/activity.rb', line 11 def link_desc @name ||= @attrs["name"].nil? ? @attrs["display_name"] : @attrs["name"] end |
#object ⇒ Object
15 16 17 18 19 20 |
# File 'lib/xing/activity.rb', line 15 def object name = @attrs["type"].camelize if Xing.const_defined?(name) @object ||= Xing.const_get(name).new(@attrs) end end |
#text ⇒ Object
Returns String.
23 24 25 26 27 28 29 |
# File 'lib/xing/activity.rb', line 23 def text @text ||= case @attrs["type"] when "status" then @attrs["content"] when "bookmark" then @attrs["description"] else nil end end |