Class: FortuneFinder::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/fortune-finder/record.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


24
25
26
# File 'lib/fortune-finder/record.rb', line 24

def alias?
  @alias ||= File.symlink? file_path
end

#domainObject



12
13
14
# File 'lib/fortune-finder/record.rb', line 12

def domain
  @domain ||= toml["domain"] if exists?
end

#exists?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/fortune-finder/record.rb', line 8

def exists?
  @exits ||= File.exists? file_path
end

#nameObject



16
17
18
# File 'lib/fortune-finder/record.rb', line 16

def name
  @name ||= toml["name"] if exists?
end

#rankObject



20
21
22
# File 'lib/fortune-finder/record.rb', line 20

def rank
  @rank ||= toml["rank"] if exists?
end