Class: Gopher::MapHandler

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

Instance Attribute Summary collapse

Attributes inherited from Handler

#application

Instance Method Summary collapse

Methods inherited from Handler

#host, #port, #with

Constructor Details

#initialize(&block) ⇒ MapHandler

Returns a new instance of MapHandler.



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

def initialize(&block)
  @block = block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



88
89
90
# File 'lib/gopher.rb', line 88

def block
  @block
end

#resultObject

Returns the value of attribute result.



88
89
90
# File 'lib/gopher.rb', line 88

def result
  @result
end

Instance Method Details

#call(*args) ⇒ Object



94
95
96
97
98
# File 'lib/gopher.rb', line 94

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