Class: Rock::SearchItem

Inherits:
Object
  • Object
show all
Defined in:
lib/rock/rock_inspect.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*info) ⇒ SearchItem

Returns a new instance of SearchItem



9
10
11
12
13
14
15
16
17
# File 'lib/rock/rock_inspect.rb', line 9

def initialize(*info)
    if info.size != 1
        raise 'Wrong number of arguments'
    end
    info = info[0]
    @object = info[:object]
    @project_name = info[:project_name]
    @name = info[:name]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name



8
9
10
# File 'lib/rock/rock_inspect.rb', line 8

def name
  @name
end

#objectObject (readonly)

Returns the value of attribute object



6
7
8
# File 'lib/rock/rock_inspect.rb', line 6

def object
  @object
end

#project_nameObject

Returns the value of attribute project_name



7
8
9
# File 'lib/rock/rock_inspect.rb', line 7

def project_name
  @project_name
end

Instance Method Details

#==(obj) ⇒ Object



28
29
30
# File 'lib/rock/rock_inspect.rb', line 28

def ==(obj)
    name == obj.name
end

#eql?(obj) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/rock/rock_inspect.rb', line 19

def eql?(obj)
    self == obj 
    name == obj.name
end

#hashObject



24
25
26
# File 'lib/rock/rock_inspect.rb', line 24

def hash
    name.hash
end