Refactor Window#initialize filters and options
This commit is contained in:
parent
7288d0ab57
commit
2a2fc58063
@ -42,17 +42,17 @@ module Teamocil
|
|||||||
def initialize(session, index, attrs={}) # {{{
|
def initialize(session, index, attrs={}) # {{{
|
||||||
@name = attrs["name"]
|
@name = attrs["name"]
|
||||||
@root = attrs["root"]
|
@root = attrs["root"]
|
||||||
@options = attrs["options"]
|
@options = attrs["options"] || {}
|
||||||
@filters = attrs["filters"]
|
|
||||||
@splits = attrs["splits"] || []
|
@splits = attrs["splits"] || []
|
||||||
@splits = @splits.each_with_index.map { |split, index| Split.new(self, index, split) }
|
@splits = @splits.each_with_index.map { |split, index| Split.new(self, index, split) }
|
||||||
@index = index
|
|
||||||
@session = session
|
|
||||||
|
|
||||||
@options ||= {}
|
@filters = attrs["filters"] || {}
|
||||||
@filters ||= {}
|
|
||||||
@filters["before"] ||= []
|
@filters["before"] ||= []
|
||||||
@filters["after"] ||= []
|
@filters["after"] ||= []
|
||||||
|
|
||||||
|
@index = index
|
||||||
|
@session = session
|
||||||
end # }}}
|
end # }}}
|
||||||
|
|
||||||
# Generate commands to send to tmux
|
# Generate commands to send to tmux
|
||||||
@ -94,6 +94,7 @@ module Teamocil
|
|||||||
@width = attrs["width"]
|
@width = attrs["width"]
|
||||||
@cmd = attrs["cmd"]
|
@cmd = attrs["cmd"]
|
||||||
@target = attrs["target"]
|
@target = attrs["target"]
|
||||||
|
|
||||||
@window = window
|
@window = window
|
||||||
@index = index
|
@index = index
|
||||||
end # }}}
|
end # }}}
|
||||||
|
Loading…
Reference in New Issue
Block a user