Class: LinksUpdater
- Inherits:
-
Object
- Object
- LinksUpdater
- Defined in:
- lib/links_updater.rb
Instance Attribute Summary collapse
-
#links_file_path ⇒ Object
readonly
Returns the value of attribute links_file_path.
-
#timestamp_file_path ⇒ Object
readonly
Returns the value of attribute timestamp_file_path.
Instance Method Summary collapse
-
#initialize ⇒ LinksUpdater
constructor
A new instance of LinksUpdater.
- #update_links_if_needed ⇒ Object
Constructor Details
#initialize ⇒ LinksUpdater
Returns a new instance of LinksUpdater.
4 5 6 7 |
# File 'lib/links_updater.rb', line 4 def initialize @timestamp_file_path = File.("../assets/last_updated.txt", File.dirname(__FILE__)) @links_file_path = File.("../assets/lists.js", File.dirname(__FILE__)) end |
Instance Attribute Details
#links_file_path ⇒ Object (readonly)
Returns the value of attribute links_file_path.
2 3 4 |
# File 'lib/links_updater.rb', line 2 def links_file_path @links_file_path end |
#timestamp_file_path ⇒ Object (readonly)
Returns the value of attribute timestamp_file_path.
2 3 4 |
# File 'lib/links_updater.rb', line 2 def @timestamp_file_path end |
Instance Method Details
#update_links_if_needed ⇒ Object
9 10 11 12 13 14 |
# File 'lib/links_updater.rb', line 9 def update_links_if_needed if is_time_to_update? update_links_from_website end end |