Class: Gopher::TextHandler
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#result ⇒ Object
Returns the value of attribute result.
Attributes inherited from Handler
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(&block) ⇒ TextHandler
constructor
A new instance of TextHandler.
Methods inherited from Handler
Constructor Details
#initialize(&block) ⇒ TextHandler
Returns a new instance of TextHandler.
106 107 108 |
# File 'lib/gopher.rb', line 106 def initialize(&block) @block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
104 105 106 |
# File 'lib/gopher.rb', line 104 def block @block end |
#result ⇒ Object
Returns the value of attribute result.
104 105 106 |
# File 'lib/gopher.rb', line 104 def result @result end |
Instance Method Details
#call(*args) ⇒ Object
110 111 112 113 114 |
# File 'lib/gopher.rb', line 110 def call(*args) context = TextContext.new context.instance_exec(*args, &block) context.result end |