Class: Nuggets::Array::HistogramMixin::HistogramItem
- Defined in:
- lib/nuggets/array/histogram_mixin.rb
Overview
Encapsulates a #histogram item and provides the following attributes (see also #annotated_histogram):
- item
-
The original item
- freq
-
The item’s frequency in the collection
- percentage
-
The percentage of the item’s frequency in the collection
- max_freq
-
The maximum frequency in the collection
- max_freq_length
-
The maximum frequency’s “width”
- max_item_length
-
The maximum item length in the collection
Instance Attribute Summary collapse
-
#freq ⇒ Object
Returns the value of attribute freq.
-
#item ⇒ Object
Returns the value of attribute item.
-
#max_freq ⇒ Object
Returns the value of attribute max_freq.
-
#max_freq_length ⇒ Object
Returns the value of attribute max_freq_length.
-
#max_item_length ⇒ Object
Returns the value of attribute max_item_length.
-
#percentage ⇒ Object
Returns the value of attribute percentage.
Instance Attribute Details
#freq ⇒ Object
Returns the value of attribute freq
57 58 59 |
# File 'lib/nuggets/array/histogram_mixin.rb', line 57 def freq @freq end |
#item ⇒ Object
Returns the value of attribute item
57 58 59 |
# File 'lib/nuggets/array/histogram_mixin.rb', line 57 def item @item end |
#max_freq ⇒ Object
Returns the value of attribute max_freq
57 58 59 |
# File 'lib/nuggets/array/histogram_mixin.rb', line 57 def max_freq @max_freq end |
#max_freq_length ⇒ Object
Returns the value of attribute max_freq_length
57 58 59 |
# File 'lib/nuggets/array/histogram_mixin.rb', line 57 def max_freq_length @max_freq_length end |
#max_item_length ⇒ Object
Returns the value of attribute max_item_length
57 58 59 |
# File 'lib/nuggets/array/histogram_mixin.rb', line 57 def max_item_length @max_item_length end |
#percentage ⇒ Object
Returns the value of attribute percentage
57 58 59 |
# File 'lib/nuggets/array/histogram_mixin.rb', line 57 def percentage @percentage end |