module Tins::DynamicScope
Attributes
dynamic_scope_name[RW]
Public Instance Methods
dynamic_defined?(id)
click to toggle source
# File lib/tins/dslkit.rb, line 638 def dynamic_defined?(id) self.dynamic_scope_name ||= :variables scope_reverse(dynamic_scope_name) { |c| c.key?(id) and return true } false end
dynamic_scope(&block)
click to toggle source
# File lib/tins/dslkit.rb, line 644 def dynamic_scope(&block) self.dynamic_scope_name ||= :variables scope_block(Context.new, dynamic_scope_name, &block) end
method_missing(id, *args)
click to toggle source
Calls superclass method
# File lib/tins/dslkit.rb, line 649 def method_missing(id, *args) self.dynamic_scope_name ||= :variables if args.empty? and scope_reverse(dynamic_scope_name) { |c| c.key?(id) and return c[id] } super elsif args.size == 1 and id.to_s =~ /(.*?)=\Z/ c = scope_top(dynamic_scope_name) or super c[$1] = args.first else super end end