lib/noip/updater.rb in noip-0.1 vs lib/noip/updater.rb in noip-0.2

- old
+ new

@@ -1,21 +1,22 @@ require 'net/http' module Noip class Updater - def initialize + def initialize(credentials) + @credentials = credentials initialize_http_request end def update @response ||= http.request(request) end private - attr_reader :http, :request, :response + attr_reader :credentials, :http, :request, :response def initialize_http_request @http = Net::HTTP.new('dynupdate.no-ip.com') @request = Net::HTTP::Get.new( @@ -32,13 +33,9 @@ @agent ||= Noip::Agent.new end def remote_ip @remote_ip ||= Noip::RemoteIp.new - end - - def credentials - @credentials ||= Noip::Credentials.new end end end