module FreeboxApi module Resources class Interface attr_reader :name, :host_count def initialize(name, host_count, freebox) @name = name @host_count = host_count @freebox = freebox end def lan_hosts JSON.parse( RestClient.get( "#{@freebox.base_url}/api/v1/lan/browser/#{@name}", :'X_Fbx_App_Auth' => @freebox.session_token ) )['result'].collect { |lan_host| FreeboxApi::Resources::LanHost.new( lan_host['id'], lan_host['primary_name'], lan_host['host_type'], lan_host['primary_name_manual'], lan_host['l2ident'], lan_host['vendor_name '], lan_host['persistent'], lan_host['reachable'], lan_host['last_time_reachable'], lan_host['active'], lan_host['last_activity'], lan_host['names'], lan_host['l3connectivities'], self, @freebox) } end end end end