Class: GraphStarter::AssetPresenter
Instance Method Summary
collapse
#h, #initialize
Instance Method Details
#asset ⇒ Object
3
4
5
|
# File 'app/presenters/graph_starter/asset_presenter.rb', line 3
def asset
@object
end
|
#associations_in_body? ⇒ Boolean
31
32
33
|
# File 'app/presenters/graph_starter/asset_presenter.rb', line 31
def associations_in_body?
@associations_in_body ||= !images_present? && !body_present? && authorized_associations.size > 0
end
|
#authorized_associations ⇒ Object
35
36
37
|
# File 'app/presenters/graph_starter/asset_presenter.rb', line 35
def authorized_associations
@authorized_associations ||= asset.class.authorized_associations
end
|
#body_present? ⇒ Boolean
27
28
29
|
# File 'app/presenters/graph_starter/asset_presenter.rb', line 27
def body_present?
@body_present ||= asset.body.present?
end
|
#display_column_widths ⇒ Object
7
8
9
10
11
12
13
|
# File 'app/presenters/graph_starter/asset_presenter.rb', line 7
def display_column_widths
if main_column_exists?
? %w(three ten three) : [nil, 'thirteen', 'three']
else
['eight', nil, 'eight']
end
end
|
#images_present? ⇒ Boolean
23
24
25
|
# File 'app/presenters/graph_starter/asset_presenter.rb', line 23
def images_present?
@images_present ||= ((asset.class.has_images? || asset.class.has_image?) && asset.image_array.present?)
end
|
15
16
17
|
# File 'app/presenters/graph_starter/asset_presenter.rb', line 15
def
@left_sidebar_exists ||= authorized_associations.size > 4
end
|
#main_column_exists? ⇒ Boolean
19
20
21
|
# File 'app/presenters/graph_starter/asset_presenter.rb', line 19
def main_column_exists?
@main_column_exists ||= images_present? || body_present? || associations_in_body?
end
|