class Zt::RemoteAPI::ZeroTierAPI

Public Class Methods

new() click to toggle source
# File lib/zt/remote_api.rb, line 13
def initialize
  @ztc = Zt::Conf.instance.conf
  # noinspection RubyStringKeysInHashInspection
  @req_opts = {
    headers: {
      'Authorization' => "Bearer #{@ztc.zt['token']}"
    }
  }
end

Public Instance Methods

network_members(network_id) click to toggle source
# File lib/zt/remote_api.rb, line 27
def network_members(network_id)
  get_parsed("/network/#{network_id}/member")
end
networks() click to toggle source
# File lib/zt/remote_api.rb, line 23
def networks
  get_parsed('/network')
end

Private Instance Methods

get_parsed(path) click to toggle source
# File lib/zt/remote_api.rb, line 33
def get_parsed(path)
  self.class.get(path, @req_opts).parsed_response
end