Cross Reference: status_viewhelper.rb
xref
: /
ontohub
/
app
/
viewhelpers
/
status_viewhelper.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
status_viewhelper.rb revision e206832a0402e82f2fd05b4d073388acc5ccb395
98
N/A
class
StatusViewhelper
98
N/A
287
N/A
TABS
= [
98
N/A
[
'Processing Ontologies'
, :
ontologies
,
98
N/A
->
(v)
{
v.processing
_ontologies_count
}],
98
N/A
]
98
N/A
98
N/A
HELPERS
=
{
98
N/A
ontologies
:
StatusOntologyViewhelper
,
98
N/A
}
98
N/A
98
N/A
attr_reader
:
tab
, :
view
, :
available_tabs
98
N/A
98
N/A
def
initialize
(
view
,
tab
)
98
N/A
@
view
=
view
98
N/A
@
tab
=
tab
98
N/A
initialize_data
98
N/A
end
98
N/A
98
N/A
def
initialize_data
98
N/A
@
available_tabs
=
TABS.map
do
|
(
tab_title
,
tab
,
count
)
|
98
N/A
[
tab_title
,
tab
,
retrieve_count
(
tab
,
count
)
]
98
N/A
end
98
N/A
end
98
N/A
98
N/A
def
retrieve_count
(
tab
,
count_proc
)
98
N/A
count_proc.call
(
initialize_helper
(
HELPERS
[
tab
])
)
if
count_proc
98
N/A
end
98
N/A
98
N/A
def
inner_helper
456
N/A
@
inner_helper
||=
initialize_helper
(
HELPERS
[
tab
])
98
N/A
end
98
N/A
98
N/A
def
initialize_helper
(
helper_klass
)
354
N/A
helper_klass.new
(
view
)
354
N/A
end
354
N/A
354
N/A
def
current
?
(
other_tab
)
354
N/A
tab
==
other_tab
354
N/A
end
354
N/A
354
N/A
def
render
354
N/A
view.render
partial
:
tab.to
_s
,
locals
: {
view
:
inner_helper
}
if
tab
354
N/A
end
354
N/A
354
N/A
98
N/A
end
98
N/A