Class: Reddit::Link

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rank, site_id, url, title, date, points = nil, author = nil) ⇒ Link

Returns a new instance of Link.



88
89
90
91
92
93
94
95
96
# File 'lib/reddit.rb', line 88

def initialize(rank, site_id, url, title, date, points=nil, author=nil)
  @rank     = rank
  @site_id  = site_id
  @url      = url
  @title    = title
  @date     = date
  @points   = points
  @author   = author
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



86
87
88
# File 'lib/reddit.rb', line 86

def date
  @date
end

#rankObject

Returns the value of attribute rank.



86
87
88
# File 'lib/reddit.rb', line 86

def rank
  @rank
end

#site_idObject

Returns the value of attribute site_id.



86
87
88
# File 'lib/reddit.rb', line 86

def site_id
  @site_id
end

#titleObject

Returns the value of attribute title.



86
87
88
# File 'lib/reddit.rb', line 86

def title
  @title
end

#urlObject

Returns the value of attribute url.



86
87
88
# File 'lib/reddit.rb', line 86

def url
  @url
end

Instance Method Details

#authorObject



98
99
100
# File 'lib/reddit.rb', line 98

def author
  @author ||= parse_author
end

#pointsObject



102
103
104
# File 'lib/reddit.rb', line 102

def points
  @points ||= parse_points
end