Class: Gonzui::ResultItem
- Inherits:
-
Object
- Object
- Gonzui::ResultItem
- Defined in:
- lib/gonzui/searchresult.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#package_id ⇒ Object
readonly
Returns the value of attribute package_id.
-
#path_id ⇒ Object
readonly
Returns the value of attribute path_id.
Instance Method Summary collapse
- #has_more? ⇒ Boolean
- #has_more_in_package ⇒ Object
- #has_more_in_package? ⇒ Boolean
- #has_more_in_path ⇒ Object
- #has_more_in_path? ⇒ Boolean
-
#initialize(package_id, path_id) ⇒ ResultItem
constructor
A new instance of ResultItem.
- #push(occ) ⇒ Object
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
#list ⇒ Object (readonly)
Returns the value of attribute list.
84 85 86 |
# File 'lib/gonzui/searchresult.rb', line 84 def list @list end |
#package_id ⇒ Object (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_id ⇒ Object (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
91 92 93 |
# File 'lib/gonzui/searchresult.rb', line 91 def has_more? not @grouped_by.nil? end |
#has_more_in_package ⇒ Object
103 104 105 |
# File 'lib/gonzui/searchresult.rb', line 103 def has_more_in_package @grouped_by = :package end |
#has_more_in_package? ⇒ Boolean
95 96 97 |
# File 'lib/gonzui/searchresult.rb', line 95 def has_more_in_package? @grouped_by == :package end |
#has_more_in_path ⇒ Object
107 108 109 |
# File 'lib/gonzui/searchresult.rb', line 107 def has_more_in_path @grouped_by = :path end |
#has_more_in_path? ⇒ 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 |