Class: RubyIpify

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_ipify.rb

Class Method Summary collapse

Class Method Details

.get_my_public_ip(args = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ruby_ipify.rb', line 12

def get_my_public_ip(args = {})
    begin
        initialize_values args
        get_ip_from_ipify
        puts "My public IP Address is: " + @response_body.to_s
        @response_body
    rescue RubyIpifyException::CustomException => e
        raise e 
    rescue => e
        raise RubyIpifyException::UnexpectedError.new e.message
    end
end