Class: Mud::Utils::LocalsBinding
- Inherits:
- BasicObject
- Defined in:
- lib/mud/utils.rb
Instance Method Summary collapse
- #binding ⇒ Object
-
#initialize(locals, &block) ⇒ LocalsBinding
constructor
A new instance of LocalsBinding.
- #js_directory(*paths) ⇒ Object
- #render(opts) ⇒ Object
Constructor Details
#initialize(locals, &block) ⇒ LocalsBinding
Returns a new instance of LocalsBinding.
107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/mud/utils.rb', line 107 def initialize(locals, &block) @_locals = locals locals.each_pair do |name, value| instance_eval %{ def #{name} _get(:#{name}) end } end instance_eval(&block) if block end |
Instance Method Details
#binding ⇒ Object
129 130 131 |
# File 'lib/mud/utils.rb', line 129 def binding ::Proc.new {}.binding end |
#js_directory(*paths) ⇒ Object
121 122 123 |
# File 'lib/mud/utils.rb', line 121 def js_directory(*paths) ::Mud.js_directory(*paths) end |