Class: Vic::Colorscheme::Highlight::Argument
- Inherits:
-
Object
- Object
- Vic::Colorscheme::Highlight::Argument
- Defined in:
- lib/vic/colorscheme/highlight/argument.rb
Constant Summary collapse
- VALID =
%w{term start stop cterm ctermfg ctermbg gui guifg guibg guisp font}
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#val ⇒ Object
Returns the value of attribute val.
Class Method Summary collapse
-
.is_valid?(key) ⇒ true, false
Checks if ‘key` is valid vim key for an argument.
Instance Method Summary collapse
-
#initialize(key, val) ⇒ Argument
constructor
A new instance of Argument.
-
#write ⇒ String?
The argument as a string.
Constructor Details
#initialize(key, val) ⇒ Argument
Returns a new instance of Argument.
7 8 9 |
# File 'lib/vic/colorscheme/highlight/argument.rb', line 7 def initialize(key, val) @key, @val = key, val end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
5 6 7 |
# File 'lib/vic/colorscheme/highlight/argument.rb', line 5 def key @key end |
#val ⇒ Object
Returns the value of attribute val.
5 6 7 |
# File 'lib/vic/colorscheme/highlight/argument.rb', line 5 def val @val end |
Class Method Details
.is_valid?(key) ⇒ true, false
Checks if ‘key` is valid vim key for an argument
23 24 25 |
# File 'lib/vic/colorscheme/highlight/argument.rb', line 23 def self.is_valid?(key) VALID.include?(key.to_s) end |
Instance Method Details
#write ⇒ String?
The argument as a string
14 15 16 17 |
# File 'lib/vic/colorscheme/highlight/argument.rb', line 14 def write return unless val "#{key}=#{val.respond_to?(:join) ? val.join(',') : val}" end |