# class BindingOfCaller::JRubyBindingHolder

### Public Class Methods

new(binding) click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 5
    def initialize(binding)
      @binding = binding
    end

### Public Instance Methods

eval(code, file = nil, line = nil) click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 9
    def eval(code, file = nil, line = nil)
      b = JRuby.dereference(RubyBinding.new(JRuby.runtime, Binding, @binding))
      if (file == nil)
        Kernel.eval code, b
      else
        Kernel.eval code, b, file, line
      end
    end

frame_description() click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 31
    def frame_description
      "#{block_desc}#{method_desc}"
    end

frame_type() click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 18
    def frame_type
      case
        when block?
          :block
        when eval?
          :eval
        when top?
          :top
        else
          :method
      end
    end

### Private Instance Methods

block?() click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 37
    def block?
      @binding.getDynamicScope().getStaticScope().isBlockScope()
    end

block_desc() click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 49
    def block_desc
      if frame_type == :block
        "block in "
      end
    end

eval?() click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 41
    def eval?
      @binding.getFrame().getKlazz().nil? && @binding.getLine() != 0
    end

method_desc() click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 55
    def method_desc
      @binding.getFrame().getName() || "<main>"
    end

top?() click to toggle source

    # File lib/binding_of_caller/jruby_interpreted.rb, line 45
    def top?
      @binding.getFrame().getKlazz().nil? && @binding.getLine() == 0
    end