Class: Ace::Tmux::Models::Pane
- Inherits:
-
Object
- Object
- Ace::Tmux::Models::Pane
- Defined in:
- lib/ace/tmux/models/pane.rb
Overview
Represents a tmux pane configuration
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#focus ⇒ Object
readonly
Returns the value of attribute focus.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #focus? ⇒ Boolean
-
#initialize(commands: [], focus: false, root: nil, name: nil, options: {}) ⇒ Pane
constructor
A new instance of Pane.
- #to_h ⇒ Object
Constructor Details
#initialize(commands: [], focus: false, root: nil, name: nil, options: {}) ⇒ Pane
Returns a new instance of Pane.
15 16 17 18 19 20 21 |
# File 'lib/ace/tmux/models/pane.rb', line 15 def initialize(commands: [], focus: false, root: nil, name: nil, options: {}) @commands = Array(commands) @focus = focus @root = root @name = name @options = || {} end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
8 9 10 |
# File 'lib/ace/tmux/models/pane.rb', line 8 def commands @commands end |
#focus ⇒ Object (readonly)
Returns the value of attribute focus.
8 9 10 |
# File 'lib/ace/tmux/models/pane.rb', line 8 def focus @focus end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/ace/tmux/models/pane.rb', line 8 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/ace/tmux/models/pane.rb', line 8 def @options end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
8 9 10 |
# File 'lib/ace/tmux/models/pane.rb', line 8 def root @root end |
Instance Method Details
#focus? ⇒ Boolean
23 24 25 |
# File 'lib/ace/tmux/models/pane.rb', line 23 def focus? @focus == true end |
#to_h ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/ace/tmux/models/pane.rb', line 27 def to_h hash = {"commands" => @commands, "focus" => @focus} hash["root"] = @root if @root hash["name"] = @name if @name hash["options"] = @options unless @options.empty? hash end |