Sha256: d41ea4a590464265ea1f83d17ab7be8789b219c45c73fd3b958cd92a29db7952

Contents?: true

Size: 383 Bytes

Versions: 1

Compression:

Stored size: 383 Bytes

Contents

module TinyDNS
  class Record < Hash
    def initialize(params = {})
      params.each do |k,v|
        self[k] = v
      end
    end

    def type
      self[:type]
    end

    def name
      self[:name]
    end

    def to_str
      str = "#{type}#{name}:#{self[:value]}:#{self[:ttl]}"
      if self[:other]
        str << ":#{self[:other]}"
      end
      str
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tinydns-data-0.0.1 lib/tinydns/record.rb