Class: Gonzui::ResultItem

Inherits:
Object
  • Object
show all
Defined in:
lib/gonzui/searchresult.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(package_id, path_id) ⇒ ResultItem

Returns a new instance of ResultItem.



76
77
78
79
80
81
# File 'lib/gonzui/searchresult.rb', line 76

def initialize(package_id, path_id)
  @package_id = package_id
  @path_id = path_id
  @list = []
  @grouped_by = nil
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



84
85
86
# File 'lib/gonzui/searchresult.rb', line 84

def list
  @list
end

#package_idObject (readonly)

Returns the value of attribute package_id.



82
83
84
# File 'lib/gonzui/searchresult.rb', line 82

def package_id
  @package_id
end

#path_idObject (readonly)

Returns the value of attribute path_id.



83
84
85
# File 'lib/gonzui/searchresult.rb', line 83

def path_id
  @path_id
end

Instance Method Details

#has_more?Boolean

Returns:

  • (Boolean)


91
92
93
# File 'lib/gonzui/searchresult.rb', line 91

def has_more?
  not @grouped_by.nil?
end

#has_more_in_packageObject



103
104
105
# File 'lib/gonzui/searchresult.rb', line 103

def has_more_in_package
  @grouped_by = :package
end

#has_more_in_package?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/gonzui/searchresult.rb', line 95

def has_more_in_package?
  @grouped_by == :package
end

#has_more_in_pathObject



107
108
109
# File 'lib/gonzui/searchresult.rb', line 107

def has_more_in_path
  @grouped_by = :path
end

#has_more_in_path?Boolean

Returns:

  • (Boolean)


99
100
101
# File 'lib/gonzui/searchresult.rb', line 99

def has_more_in_path?
  @grouped_by == :path
end

#push(occ) ⇒ Object



87
88
89
# File 'lib/gonzui/searchresult.rb', line 87

def push(occ)
  @list.push(occ)
end