Class: Dedalus::PatternLibrary::ApplicationView

Inherits:
ApplicationView
  • Object
show all
Defined in:
lib/dedalus/pattern_library/application_view.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationView

#click, #compose, #dimensions, #initialize, #mouse_position, #render

Constructor Details

This class inherits a constructor from Dedalus::ApplicationView

Instance Attribute Details

#library_viewObject

Returns the value of attribute library_view.



4
5
6
# File 'lib/dedalus/pattern_library/application_view.rb', line 4

def library_view
  @library_view
end

Instance Method Details

#app_screenObject



6
7
8
9
10
11
12
13
14
# File 'lib/dedalus/pattern_library/application_view.rb', line 6

def app_screen
  ApplicationScreen.new(app_template).hydrate(
    mouse_position: mouse_position,
    library_section_tabs: library_view.library_section_tabs,
    current_entry_name: current_entry_name,
    library_sections: library_view.library_sections,
    library_items: library_view.library_items
  )
end

#app_templateObject



16
17
18
# File 'lib/dedalus/pattern_library/application_view.rb', line 16

def app_template
  ApplicationTemplate.new
end

#current_entry_nameObject



20
21
22
# File 'lib/dedalus/pattern_library/application_view.rb', line 20

def current_entry_name
  @current_entry_name ||= "Welcome"
end

#route_to(section_name) ⇒ Object



24
25
26
# File 'lib/dedalus/pattern_library/application_view.rb', line 24

def route_to(section_name)
  @current_entry_name = section_name
end