Class: WebAssets::ClientInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/web_assets/client_interface.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api, options = {}) ⇒ ClientInterface

Returns a new instance of ClientInterface.



9
10
11
12
13
# File 'lib/web_assets/client_interface.rb', line 9

def initialize api, options = {}
  @api = api
  @input = options.fetch :input, STDIN
  @output = options.fetch :output, STDOUT
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



7
8
9
# File 'lib/web_assets/client_interface.rb', line 7

def api
  @api
end

#inputObject (readonly)

Returns the value of attribute input.



7
8
9
# File 'lib/web_assets/client_interface.rb', line 7

def input
  @input
end

#outputObject (readonly)

Returns the value of attribute output.



7
8
9
# File 'lib/web_assets/client_interface.rb', line 7

def output
  @output
end

Instance Method Details

#listenObject



15
16
17
18
19
20
# File 'lib/web_assets/client_interface.rb', line 15

def listen
  Kernel.receive input, output do |request|
    WebAssets.logger.debug "ClientInterface#listen: request = #{request.inspect}"
    process request
  end
end