Class: ForbesFinder::Record

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain) ⇒ Record

Returns a new instance of Record.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/forbes-finder/record.rb', line 8

def initialize(domain)
  begin
    toml_record = TOML.load_file(File.expand_path(__FILE__+"/../../data/2012/#{domain}.toml"))
    @name       = toml_record["name"]
    @rank       = toml_record["rank"]
    @domain     = toml_record["domain"]

    if File.symlink?(File.expand_path(__FILE__+"/../../data/2012/#{domain}.toml"))
      @alias = true
    end
  rescue Error => e
    puts e.inspect
  end
end

Instance Attribute Details

#aliasObject

Returns the value of attribute alias.



6
7
8
# File 'lib/forbes-finder/record.rb', line 6

def alias
  @alias
end

#domainObject

Returns the value of attribute domain.



3
4
5
# File 'lib/forbes-finder/record.rb', line 3

def domain
  @domain
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/forbes-finder/record.rb', line 4

def name
  @name
end

#rankObject

Returns the value of attribute rank.



5
6
7
# File 'lib/forbes-finder/record.rb', line 5

def rank
  @rank
end