Class: Topsy::Linkpost
- Inherits:
-
Object
- Object
- Topsy::Linkpost
- Defined in:
- lib/rtopsy/linkpost.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#date ⇒ Object
Returns the value of attribute date.
-
#date_alpha ⇒ Object
Returns the value of attribute date_alpha.
-
#permalink_url ⇒ Object
Returns the value of attribute permalink_url.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Linkpost
constructor
A new instance of Linkpost.
- #to_s ⇒ Object
Constructor Details
#initialize(hash) ⇒ Linkpost
Returns a new instance of Linkpost.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rtopsy/linkpost.rb', line 22 def initialize(hash) hash.each do |key, value| if key == 'target' instance_variable_set("@#{key}", Target.new(value)) else instance_variable_set("@#{key}", value) end end end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
16 17 18 |
# File 'lib/rtopsy/linkpost.rb', line 16 def content @content end |
#date ⇒ Object
Returns the value of attribute date.
16 17 18 |
# File 'lib/rtopsy/linkpost.rb', line 16 def date @date end |
#date_alpha ⇒ Object
Returns the value of attribute date_alpha.
16 17 18 |
# File 'lib/rtopsy/linkpost.rb', line 16 def date_alpha @date_alpha end |
#permalink_url ⇒ Object
Returns the value of attribute permalink_url.
16 17 18 |
# File 'lib/rtopsy/linkpost.rb', line 16 def permalink_url @permalink_url end |
#target ⇒ Object
Returns the value of attribute target.
16 17 18 |
# File 'lib/rtopsy/linkpost.rb', line 16 def target @target end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/rtopsy/linkpost.rb', line 18 def to_s "Topsy Linkpost: #{permalink_url}, @#{content}" end |