Class: GitStats::StatsView::ViewData
- Inherits:
-
Object
- Object
- GitStats::StatsView::ViewData
- Includes:
- LazyHighCharts::LayoutHelper
- Defined in:
- lib/git_stats/stats_view/view_data.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #asset_path(asset, active_page) ⇒ Object
- #charts ⇒ Object
-
#initialize(repo) ⇒ ViewData
constructor
A new instance of ViewData.
- #link_to(href, active_page) ⇒ Object
- #render_partial(template_name, params = {}) ⇒ Object
Constructor Details
#initialize(repo) ⇒ ViewData
Returns a new instance of ViewData.
7 8 9 |
# File 'lib/git_stats/stats_view/view_data.rb', line 7 def initialize(repo) @repo = repo end |
Instance Attribute Details
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
5 6 7 |
# File 'lib/git_stats/stats_view/view_data.rb', line 5 def repo @repo end |
Instance Method Details
#asset_path(asset, active_page) ⇒ Object
19 20 21 |
# File 'lib/git_stats/stats_view/view_data.rb', line 19 def asset_path(asset, active_page) Pathname.new("/assets/#{asset}").relative_path_from(Pathname.new("/#{active_page}").dirname) end |
#charts ⇒ Object
11 12 13 |
# File 'lib/git_stats/stats_view/view_data.rb', line 11 def charts @charts ||= Charts::All.new(repo) end |
#link_to(href, active_page) ⇒ Object
23 24 25 |
# File 'lib/git_stats/stats_view/view_data.rb', line 23 def link_to(href, active_page) Pathname.new("/#{href}").relative_path_from(Pathname.new("/#{active_page}").dirname) end |