Class: BaseVelocitator
- Inherits:
-
Object
- Object
- BaseVelocitator
- Includes:
- Helpers
- Defined in:
- lib/gem_velocity/velocitators/base_velocitator.rb
Direct Known Subclasses
AggregatedVelocitator, MultipleVelocitator, SingleVelocitator
Instance Attribute Summary collapse
-
#date_range ⇒ Object
modifiers on the end result image being rendered.
-
#gem_name ⇒ Object
Returns the value of attribute gem_name.
-
#max_value ⇒ Object
modifiers on the end result image being rendered.
-
#min_value ⇒ Object
modifiers on the end result image being rendered.
-
#root ⇒ Object
modifiers on the end result image being rendered.
-
#versions ⇒ Object
Returns the value of attribute versions.
Instance Method Summary collapse
- #effective_date_range ⇒ Object
- #effective_max_value ⇒ Object
- #effective_min_value ⇒ Object
- #graph(root_arg = nil, range = nil, min = nil, max = nil) ⇒ Object
- #num_downloads ⇒ Object
- #totals ⇒ Object
Methods included from Helpers
#time_format_str, #time_format_str_small
Instance Attribute Details
#date_range ⇒ Object
modifiers on the end result image being rendered. Essentially these are the boundries of the graph
20 21 22 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 20 def date_range @date_range end |
#gem_name ⇒ Object
Returns the value of attribute gem_name.
11 12 13 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 11 def gem_name @gem_name end |
#max_value ⇒ Object
modifiers on the end result image being rendered. Essentially these are the boundries of the graph
20 21 22 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 20 def max_value @max_value end |
#min_value ⇒ Object
modifiers on the end result image being rendered. Essentially these are the boundries of the graph
20 21 22 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 20 def min_value @min_value end |
#root ⇒ Object
modifiers on the end result image being rendered. Essentially these are the boundries of the graph
20 21 22 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 20 def root @root end |
#versions ⇒ Object
Returns the value of attribute versions.
11 12 13 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 11 def versions @versions end |
Instance Method Details
#effective_date_range ⇒ Object
26 27 28 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 26 def effective_date_range @passed_date_range || default_date_range end |
#effective_max_value ⇒ Object
30 31 32 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 30 def effective_max_value @passed_max_value || default_max_value end |
#effective_min_value ⇒ Object
34 35 36 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 34 def effective_min_value @passed_min_value || default_min_value end |
#graph(root_arg = nil, range = nil, min = nil, max = nil) ⇒ Object
13 14 15 16 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 13 def graph(root_arg = nil, range = nil, min = nil, max = nil) set_overwritable_attrs(root_arg,range,min,max) gruff_builder.write end |
#num_downloads ⇒ Object
44 45 46 47 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 44 def num_downloads sum = totals.map {|t| t[:version_downloads]}.sum ActiveSupport::NumberHelper.number_to_delimited(sum) end |
#totals ⇒ Object
38 39 40 41 42 |
# File 'lib/gem_velocity/velocitators/base_velocitator.rb', line 38 def totals versions.map do |v| gem_data.total_for_version(v) end end |