Class: Pingdom::ServerTime

Inherits:
Base
  • Object
show all
Defined in:
lib/pingdom/server_time.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#additional_field

Class Method Summary collapse

Methods inherited from Base

#add, all, body, client, collection, collection_type, error?, find, #get, #initialize, limited, params, params=, parse, permit, status, total, update_client

Constructor Details

This class inherits a constructor from Pingdom::Base

Instance Attribute Details

#servertimeObject

Returns the value of attribute servertime.



29
30
31
# File 'lib/pingdom/server_time.rb', line 29

def servertime
  @servertime
end

Class Method Details

.getObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/pingdom/server_time.rb', line 11

def get
  parse client.get( path: path )

  if body.include?('servertime')
    server_time=self.new body
  end

  server_time

end

.pathObject



7
8
9
# File 'lib/pingdom/server_time.rb', line 7

def path
  '/servertime'
end

.timeObject



22
23
24
# File 'lib/pingdom/server_time.rb', line 22

def time
  get.servertime
end