Class: Dps::DNS::Endpoint

Inherits:
Struct
  • Object
show all
Defined in:
lib/dps/dns.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



76
77
78
# File 'lib/dps/dns.rb', line 76

def data
  @data
end

Instance Method Details

#get_url_partObject



97
98
99
# File 'lib/dps/dns.rb', line 97

def get_url_part
  data.find { |d| d =~ /^url=/ } 
end

#uriObject



84
85
86
87
88
89
90
91
# File 'lib/dps/dns.rb', line 84

def uri
  @uri ||= 
    begin
      URI(get_url_part.sub(/^url=/, ''))
    rescue 
      nil
    end
end

#urlObject



93
94
95
# File 'lib/dps/dns.rb', line 93

def url
  uri && uri.to_s
end

#valid?Boolean

Returns:

  • (Boolean)


77
78
79
80
81
82
# File 'lib/dps/dns.rb', line 77

def valid?
  uri &&
  uri.query.nil? &&
  uri.fragment.nil? &&
  uri.port == 443
end