Sha256: 2efa7608d42ce7ee7b3d91badd4d1dd3c7d51a53a7ed8561bd1c41ec328c777a

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

module FortuneFinder
  class Record
    attr_accessor :domain
    attr_accessor :name
    attr_accessor :rank
    attr_accessor :alias

    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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fortune-finder-0.1.0 lib/fortune-finder/record.rb