Class: Fiveruns::Dash::Update

Inherits:
Object
  • Object
show all
Includes:
Store::File, Store::HTTP
Defined in:
lib/fiveruns/dash/update.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Store::File

#filename, #store_file, #write_to

Methods included from Store::HTTP

#add_path_to, #app_token, #check_response_of, #extra_params_for, #normalize_key, #resolved_hostname, #resolved_hostnames, #safely, #set_trace_contexts, #store_http, #transmit_to

Constructor Details

#initialize(payload, &handler) ⇒ Update

Returns a new instance of Update.



70
71
72
73
# File 'lib/fiveruns/dash/update.rb', line 70

def initialize(payload, &handler)
  @payload = payload
  @handler = handler
end

Instance Attribute Details

#handlerObject (readonly)

Returns the value of attribute handler.



69
70
71
# File 'lib/fiveruns/dash/update.rb', line 69

def handler
  @handler
end

#payloadObject (readonly)

Returns the value of attribute payload.



69
70
71
# File 'lib/fiveruns/dash/update.rb', line 69

def payload
  @payload
end

Instance Method Details

#guidObject



87
88
89
# File 'lib/fiveruns/dash/update.rb', line 87

def guid
  @guid ||= timestamp << "_#{Process.pid}"
end

#ping(*urls) ⇒ Object



83
84
85
# File 'lib/fiveruns/dash/update.rb', line 83

def ping(*urls)
  Pinger.new(payload).ping(*urls)
end

#store(*urls) ⇒ Object



75
76
77
78
79
80
81
# File 'lib/fiveruns/dash/update.rb', line 75

def store(*urls)
  uris_by_scheme(urls).each do |scheme, uris|
    value = __send__("store_#{storage_method_for(scheme)}", *uris)
    return value if value
  end
  return false
end