class TheFox::MBDB::Record

Attributes

domain[R]
file_size[RW]
path[RW]

Public Class Methods

new() click to toggle source
# File lib/mbdb/record.rb, line 14
def initialize
        @domain_name = ''
        @domain = nil
        @path = ''
        @file_size = 0
end

Public Instance Methods

domain=(domain) click to toggle source
# File lib/mbdb/record.rb, line 21
def domain=(domain)
        @domain_name = domain
        domains = domain.split('-')
        root_domain = domains.shift
        @domain = Pathname.new(root_domain).join(*domains)
end
is_file?() click to toggle source
# File lib/mbdb/record.rb, line 32
def is_file?
        @file_size > 0
end
src_file_name() click to toggle source
# File lib/mbdb/record.rb, line 28
def src_file_name
        Pathname.new(Digest::SHA1.hexdigest("#{@domain_name}-#{@path}"))
end
to_s() click to toggle source
# File lib/mbdb/record.rb, line 36
def to_s
        "#{@domain}@#{@path}"
end