class Cradlepoint::NetFlow

Attributes

data[RW]
mac[RW]
router[RW]
status_data[RW]

Public Class Methods

new(mac = nil, router = nil) click to toggle source
# File lib/cradlepoint/net_flow.rb, line 6
def initialize(mac = nil, router = nil)
  self.mac = mac
  self.router = router
end
rel_url() click to toggle source
# File lib/cradlepoint/net_flow.rb, line 11
def self.rel_url
  '/remote'
end

Public Instance Methods

get() click to toggle source
# File lib/cradlepoint/net_flow.rb, line 19
def get
  raise 'You must provide a mac' unless self.mac
  return self.data if self.data
  self.data = Cradlepoint.make_request(:get, build_new_url(rel_url), params)
end
get_status() click to toggle source
# File lib/cradlepoint/net_flow.rb, line 25
def get_status
  raise 'You must provide a mac' unless self.mac
  return self.status_data if self.status_data
  self.status_data = Cradlepoint.make_request(:get, build_new_url("#{ rel_url }/status"), params)
end
get_wan_devices() click to toggle source
# File lib/cradlepoint/net_flow.rb, line 31
def get_wan_devices
  raise 'You must provide a mac' unless self.mac
  Cradlepoint.make_request(:get, build_new_url("#{ rel_url }/status/wan/devices"), params)
end
params() click to toggle source
# File lib/cradlepoint/net_flow.rb, line 36
def params
  { format: :json, mac: self.mac, limit: 1 }
end
rel_url() click to toggle source
# File lib/cradlepoint/net_flow.rb, line 15
def rel_url
  Cradlepoint::NetFlow.rel_url
end