Class: ForbesFinder::Record
- Inherits:
-
Object
- Object
- ForbesFinder::Record
- Defined in:
- lib/forbes-finder/record.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
Returns the value of attribute alias.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rank ⇒ Object
Returns the value of attribute rank.
Instance Method Summary collapse
-
#initialize(domain) ⇒ Record
constructor
A new instance of Record.
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.(__FILE__+"/../../data/2012/#{domain}.toml")) @name = toml_record["name"] @rank = toml_record["rank"] @domain = toml_record["domain"] if File.symlink?(File.(__FILE__+"/../../data/2012/#{domain}.toml")) @alias = true end rescue Error => e puts e.inspect end end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
6 7 8 |
# File 'lib/forbes-finder/record.rb', line 6 def alias @alias end |
#domain ⇒ Object
Returns the value of attribute domain.
3 4 5 |
# File 'lib/forbes-finder/record.rb', line 3 def domain @domain end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/forbes-finder/record.rb', line 4 def name @name end |
#rank ⇒ Object
Returns the value of attribute rank.
5 6 7 |
# File 'lib/forbes-finder/record.rb', line 5 def rank @rank end |