Refactor Window#initialize filters and options

This commit is contained in:
Rémi Prévost 2011-10-24 07:43:37 -04:00
parent 7288d0ab57
commit 2a2fc58063

View File

@ -42,17 +42,17 @@ module Teamocil
def initialize(session, index, attrs={}) # {{{
@name = attrs["name"]
@root = attrs["root"]
@options = attrs["options"]
@filters = attrs["filters"]
@options = attrs["options"] || {}
@splits = attrs["splits"] || []
@splits = @splits.each_with_index.map { |split, index| Split.new(self, index, split) }
@index = index
@session = session
@options ||= {}
@filters ||= {}
@filters = attrs["filters"] || {}
@filters["before"] ||= []
@filters["after"] ||= []
@index = index
@session = session
end # }}}
# Generate commands to send to tmux
@ -94,6 +94,7 @@ module Teamocil
@width = attrs["width"]
@cmd = attrs["cmd"]
@target = attrs["target"]
@window = window
@index = index
end # }}}