Class: FortuneFinder::Record
- Inherits:
-
Object
- Object
- FortuneFinder::Record
- Defined in:
- lib/fortune-finder/record.rb
Instance Method Summary collapse
- #alias? ⇒ Boolean (also: #alias)
- #domain ⇒ Object
- #exists? ⇒ Boolean
-
#initialize(raw_domain) ⇒ Record
constructor
A new instance of Record.
- #name ⇒ Object
- #rank ⇒ Object
Constructor Details
#initialize(raw_domain) ⇒ Record
Returns a new instance of Record.
4 5 6 |
# File 'lib/fortune-finder/record.rb', line 4 def initialize(raw_domain) @raw_domain = raw_domain.to_s end |
Instance Method Details
#alias? ⇒ Boolean Also known as: alias
24 25 26 |
# File 'lib/fortune-finder/record.rb', line 24 def alias? @alias ||= File.symlink? file_path end |
#domain ⇒ Object
12 13 14 |
# File 'lib/fortune-finder/record.rb', line 12 def domain @domain ||= toml["domain"] if exists? end |
#exists? ⇒ Boolean
8 9 10 |
# File 'lib/fortune-finder/record.rb', line 8 def exists? @exits ||= File.exists? file_path end |
#name ⇒ Object
16 17 18 |
# File 'lib/fortune-finder/record.rb', line 16 def name @name ||= toml["name"] if exists? end |
#rank ⇒ Object
20 21 22 |
# File 'lib/fortune-finder/record.rb', line 20 def rank @rank ||= toml["rank"] if exists? end |