Class: PublicIp::Service::MatchedExpression

Inherits:
Simple
  • Object
show all
Extended by:
Registrable
Defined in:
lib/public_ip/service/matched_expression.rb

Direct Known Subclasses

Dyndns

Instance Attribute Summary collapse

Attributes inherited from Simple

#headers, #uri

Class Method Summary collapse

Methods included from Registrable

inherited

Methods inherited from Simple

headers, ip, perform_request, symbol, uri

Instance Attribute Details

#match_regexObject (readonly)

Returns the value of attribute match_regex.



6
7
8
# File 'lib/public_ip/service/matched_expression.rb', line 6

def match_regex
  @match_regex
end

Class Method Details

.extract_ip(response) ⇒ Object



8
9
10
# File 'lib/public_ip/service/matched_expression.rb', line 8

def self.extract_ip(response)
  response.body.match(match_regex)[1].strip
end