Class: Link
- Inherits:
-
Object
- Object
- Link
- Defined in:
- lib/cinch/plugins/links-logger/link.rb
Overview
Class to track Link data
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#nick ⇒ Object
Returns the value of attribute nick.
-
#short_url ⇒ Object
Returns the value of attribute short_url.
-
#time ⇒ Object
Returns the value of attribute time.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #inc_count(count = 1) ⇒ Object
-
#initialize(nick, url, time = Time.now) ⇒ Link
constructor
A new instance of Link.
Constructor Details
#initialize(nick, url, time = Time.now) ⇒ Link
Returns a new instance of Link.
6 7 8 9 10 11 12 |
# File 'lib/cinch/plugins/links-logger/link.rb', line 6 def initialize(nick, url, time = Time.now) @nick = nick @title = Cinch::Toolbox.get_page_title(url) @count = 0 @short_url = Cinch::Toolbox.shorten(url) @time = time end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
4 5 6 |
# File 'lib/cinch/plugins/links-logger/link.rb', line 4 def count @count end |
#nick ⇒ Object
Returns the value of attribute nick.
4 5 6 |
# File 'lib/cinch/plugins/links-logger/link.rb', line 4 def nick @nick end |
#short_url ⇒ Object
Returns the value of attribute short_url.
4 5 6 |
# File 'lib/cinch/plugins/links-logger/link.rb', line 4 def short_url @short_url end |
#time ⇒ Object
Returns the value of attribute time.
4 5 6 |
# File 'lib/cinch/plugins/links-logger/link.rb', line 4 def time @time end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/cinch/plugins/links-logger/link.rb', line 4 def title @title end |
Instance Method Details
#inc_count(count = 1) ⇒ Object
14 15 16 |
# File 'lib/cinch/plugins/links-logger/link.rb', line 14 def inc_count(count = 1) @count += count end |