Class: Topsy::Linkpost

Inherits:
Object
  • Object
show all
Defined in:
lib/rtopsy/linkpost.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject

Returns the value of attribute content.



16
17
18
# File 'lib/rtopsy/linkpost.rb', line 16

def content
  @content
end

#dateObject

Returns the value of attribute date.



16
17
18
# File 'lib/rtopsy/linkpost.rb', line 16

def date
  @date
end

#date_alphaObject

Returns the value of attribute date_alpha.



16
17
18
# File 'lib/rtopsy/linkpost.rb', line 16

def date_alpha
  @date_alpha
end

Returns the value of attribute permalink_url.



16
17
18
# File 'lib/rtopsy/linkpost.rb', line 16

def permalink_url
  @permalink_url
end

#targetObject

Returns the value of attribute target.



16
17
18
# File 'lib/rtopsy/linkpost.rb', line 16

def target
  @target
end

Instance Method Details

#to_sObject



18
19
20
# File 'lib/rtopsy/linkpost.rb', line 18

def to_s
  "Topsy Linkpost: #{permalink_url}, @#{content}"
end