class Rock::GenericView

Attributes

name[R]

Public Class Methods

new(search_item) click to toggle source
# File lib/rock/rock_inspect.rb, line 307
def initialize(search_item)
    obj = search_item.object
    @name = search_item.name
    @project_name = search_item.project_name
    @object = obj
    @header = "Name:"
    @header2 = nil
end

Public Instance Methods

==(obj) click to toggle source
# File lib/rock/rock_inspect.rb, line 324
def ==(obj)
    @name == obj.name
end
eql?(obj) click to toggle source
# File lib/rock/rock_inspect.rb, line 320
def eql?(obj)
    self == obj
end
hash() click to toggle source
# File lib/rock/rock_inspect.rb, line 316
def hash
    @name.hash
end
pretty_print(pp) click to toggle source
# File lib/rock/rock_inspect.rb, line 328
def pretty_print(pp)
    pp.text "=========================================================="
    pp.breakable
    pp.text "#{@header} #{@name}"
    pp.breakable
    pp.text "defined in #{@project_name}"
    pp.breakable
    if @header2
        pp.text "#{@header2}"
        pp.breakable
    end
    pp.text "----------------------------------------------------------"
    if((@object && @object.respond_to?(:pretty_print)))
        pp.breakable
        pp.nest(2) do 
            pp.breakable
            @object.pretty_print(pp)
        end
    end
    pp.breakable
end