Class: Tmux::Options::Option Abstract Private
- Inherits:
-
Object
- Object
- Tmux::Options::Option
- Defined in:
- lib/tmux/options/option.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This class is the base for all typecasting in ruby-tmux. It will
handle default
and none
. All other conversions have to be
done by classes inheriting from this one. You should never have
to instantiate or work with any of those classes yourself.
Direct Known Subclasses
BooleanOption, CharArrayOption, NumberOption, StringOption, SymbolOption, WordArrayOption
Class Method Summary collapse
-
.from_tmux(value) ⇒ Object, Symbol
private
Takes an option value from tmux and converts it to an appropriate Ruby object.
-
.to_tmux(value) ⇒ String
private
Converts a Ruby object to a value for tmux.
Class Method Details
.from_tmux(value) ⇒ Object, Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Takes an option value from tmux and converts it to an appropriate Ruby object.
18 19 20 21 22 |
# File 'lib/tmux/options/option.rb', line 18 def from_tmux(value) if [:default, :none].include?(value) return value.to_sym end end |
.to_tmux(value) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Converts a Ruby object to a value for tmux.
30 31 32 33 34 |
# File 'lib/tmux/options/option.rb', line 30 def to_tmux(value) if [:default, :none].include?(value) return value.to_s end end |