Class: Mucks::SessionConfig
- Inherits:
-
BaseConfig
- Object
- BaseConfig
- Mucks::SessionConfig
- Defined in:
- lib/mucks/mucks.rb
Instance Attribute Summary collapse
-
#session_names ⇒ Object
readonly
Returns the value of attribute session_names.
-
#sessions ⇒ Object
readonly
Returns the value of attribute sessions.
Attributes inherited from BaseConfig
Instance Method Summary collapse
-
#initialize(path) ⇒ SessionConfig
constructor
A new instance of SessionConfig.
- #layouts ⇒ Object
- #remove_by_layout(layout_name) ⇒ Object
Methods inherited from BaseConfig
#show_self, #stringify_elements_for
Constructor Details
#initialize(path) ⇒ SessionConfig
Returns a new instance of SessionConfig.
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/mucks/mucks.rb', line 79 def initialize(path) super @sessions = unique_sessions.map do |session_name| SessionElement.new session_name, @config[session_name] end @session_names = Set.new @config.each do |k, v| @session_names << k end end |
Instance Attribute Details
#session_names ⇒ Object (readonly)
Returns the value of attribute session_names.
77 78 79 |
# File 'lib/mucks/mucks.rb', line 77 def session_names @session_names end |
#sessions ⇒ Object (readonly)
Returns the value of attribute sessions.
77 78 79 |
# File 'lib/mucks/mucks.rb', line 77 def sessions @sessions end |
Instance Method Details
#layouts ⇒ Object
92 93 94 95 96 |
# File 'lib/mucks/mucks.rb', line 92 def layouts @sessions.map do |session| session.layout end.uniq end |
#remove_by_layout(layout_name) ⇒ Object
98 99 100 101 102 |
# File 'lib/mucks/mucks.rb', line 98 def remove_by_layout(layout_name) @sessions.reject! do |session| session.layout == layout_name end end |