Class: RecordStore::Record::CAA

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

Constant Summary collapse

LABEL_REGEX =
'[a-z0-9](?:-*[a-z0-9])*'
DOMAIN_REGEX =
/\A#{LABEL_REGEX}(?:\.#{LABEL_REGEX})\z/i

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) ⇒ CAA

Returns a new instance of CAA.



18
19
20
21
22
23
# File 'lib/record_store/record/caa.rb', line 18

def initialize(record)
  super
  @flags = Integer(record.fetch(:flags))
  @tag = record.fetch(:tag)
  @value = record.fetch(:value)
end

Instance Attribute Details

#flagsObject

Returns the value of attribute flags.



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

def flags
  @flags
end

#tagObject

Returns the value of attribute tag.



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

def tag
  @tag
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#rdataObject



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

def rdata
  {
    flags: flags,
    tag: tag,
    value: value,
  }
end

#rdata_txtObject



33
34
35
# File 'lib/record_store/record/caa.rb', line 33

def rdata_txt
  "#{flags} #{tag} \"#{value}\""
end