Class: RecordStore::Record::SRV

Inherits:
RecordStore::Record show all
Defined in:
lib/record_store/record/srv.rb

Constant Summary

Constants inherited from RecordStore::Record

CNAME_REGEX, FQDN_REGEX

Instance Attribute Summary collapse

Attributes inherited from RecordStore::Record

#fqdn, #id, #ttl

Instance Method Summary collapse

Methods inherited from RecordStore::Record

#==, build_from_yaml_definition, ensure_ends_with_dot, ensure_ends_without_dot, escape, #hash, #key, #log!, long_quote, needs_long_quotes?, quote, #to_hash, #to_json, #to_s, #type, unescape, unlong_quote, unquote, #wildcard?

Constructor Details

#initialize(record) ⇒ SRV

Returns a new instance of SRV.



26
27
28
29
30
31
32
# File 'lib/record_store/record/srv.rb', line 26

def initialize(record)
  super
  @priority = record.fetch(:priority)
  @weight   = record.fetch(:weight)
  @port     = record.fetch(:port)
  @target   = record.fetch(:target)
end

Instance Attribute Details

#portObject

Returns the value of attribute port.



3
4
5
# File 'lib/record_store/record/srv.rb', line 3

def port
  @port
end

#priorityObject

Returns the value of attribute priority.



3
4
5
# File 'lib/record_store/record/srv.rb', line 3

def priority
  @priority
end

#targetObject

Returns the value of attribute target.



3
4
5
# File 'lib/record_store/record/srv.rb', line 3

def target
  @target
end

#weightObject

Returns the value of attribute weight.



3
4
5
# File 'lib/record_store/record/srv.rb', line 3

def weight
  @weight
end

Instance Method Details

#rdataObject



34
35
36
# File 'lib/record_store/record/srv.rb', line 34

def rdata
  { priority: priority, port: port, weight: weight, target: target }
end

#rdata_txtObject



38
39
40
# File 'lib/record_store/record/srv.rb', line 38

def rdata_txt
  "#{priority} #{weight} #{port} #{target}"
end