Class: Freenom::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/freenom/dns/models/record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, type:, time_to_live:, target:) ⇒ Record

Returns a new instance of Record.



7
8
9
10
11
12
# File 'lib/freenom/dns/models/record.rb', line 7

def initialize(name:, type:, time_to_live:, target:)
  @name = name
  @type = type
  @time_to_live = time_to_live
  @target = target
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/freenom/dns/models/record.rb', line 5

def name
  @name
end

#targetObject

Returns the value of attribute target.



5
6
7
# File 'lib/freenom/dns/models/record.rb', line 5

def target
  @target
end

#time_to_liveObject

Returns the value of attribute time_to_live.



5
6
7
# File 'lib/freenom/dns/models/record.rb', line 5

def time_to_live
  @time_to_live
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/freenom/dns/models/record.rb', line 5

def type
  @type
end

Instance Method Details

#match?(options = {}) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
# File 'lib/freenom/dns/models/record.rb', line 14

def match?(options = {})
  return false if options[:name] && @name != options[:name]
  return false if options[:type] && @type != options[:type]
  return false if options[:time_to_live] && @time_to_live != options[:time_to_live].to_s
  return false if options[:target] && @target != options[:target]

  true
end