Sha256: a75327cbbfd74d49221df37f973ba8303a999b34b179dd801850e594f4d86ddf

Contents?: true

Size: 749 Bytes

Versions: 3

Compression:

Stored size: 749 Bytes

Contents

module Cradlepoint
  class NetFlow < CradlepointObject

    attr_accessor :mac, :router, :data, :status_data

    def initialize(mac = nil, router = nil)
      self.mac = mac
      self.router = router
    end

    def self.rel_url
      '/remote'
    end

    def rel_url
      Cradlepoint::NetFlow.rel_url
    end

    def get
      raise 'You must provide a mac' unless self.mac
      self.data = Cradlepoint.make_request(:get, build_new_url(rel_url), params)
    end

    def get_status
      raise 'You must provide a mac' unless self.mac
      self.status_data = Cradlepoint.make_request(:get, build_new_url("#{ rel_url }/status"), params)
    end

    def params
      { params: { format: :json, mac: self.mac, limit: 1 } }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cradlepoint-0.2.0 lib/cradlepoint/net_flow.rb
cradlepoint-0.1.2 lib/cradlepoint/net_flow.rb
cradlepoint-0.1.1 lib/cradlepoint/net_flow.rb