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, #hash, #key, #log!, #to_hash, #to_json, #type

Constructor Details

#initialize(record) ⇒ SRV



10
11
12
13
14
15
16
# File 'lib/record_store/record/srv.rb', line 10

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



22
23
24
# File 'lib/record_store/record/srv.rb', line 22

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

#to_sObject



18
19
20
# File 'lib/record_store/record/srv.rb', line 18

def to_s
  "[SRVRecord] #{fqdn} #{ttl} IN SRV #{priority} #{weight} #{port} #{target}"
end