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.
9 10 11 |
# File 'lib/git_stats/stats_view/view_data.rb', line 9 def initialize(repo) @repo = repo end |
Instance Attribute Details
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
7 8 9 |
# File 'lib/git_stats/stats_view/view_data.rb', line 7 def repo @repo end |
Instance Method Details
#asset_path(asset, active_page) ⇒ Object
21 22 23 |
# File 'lib/git_stats/stats_view/view_data.rb', line 21 def asset_path(asset, active_page) Pathname.new("/assets/#{asset}").relative_path_from(Pathname.new("/#{active_page}").dirname) end |
#charts ⇒ Object
13 14 15 |
# File 'lib/git_stats/stats_view/view_data.rb', line 13 def charts @charts ||= Charts::All.new(repo) end |
#link_to(href, active_page) ⇒ Object
25 26 27 |
# File 'lib/git_stats/stats_view/view_data.rb', line 25 def link_to(href, active_page) Pathname.new("/#{href}").relative_path_from(Pathname.new("/#{active_page}").dirname) end |