Class: Gopher::MapHandler

Inherits:
Handler
  • Object
show all
Defined in:
lib/gopher.rb

Instance Attribute Summary collapse

Attributes inherited from Handler

#app

Instance Method Summary collapse

Methods inherited from Handler

#bindto, #host, #port, #with

Constructor Details

#initialize(&block) ⇒ MapHandler

Returns a new instance of MapHandler.



93
94
95
# File 'lib/gopher.rb', line 93

def initialize(&block)
  @block = block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



91
92
93
# File 'lib/gopher.rb', line 91

def block
  @block
end

#resultObject

Returns the value of attribute result.



91
92
93
# File 'lib/gopher.rb', line 91

def result
  @result
end

Instance Method Details

#call(*args) ⇒ Object



97
98
99
100
101
# File 'lib/gopher.rb', line 97

def call(*args)
  context = MapContext.new(host, port)
  context.instance_exec(*args, &block)
  context.result
end