Class: Weechat::Bar
- Inherits:
-
Object
- Object
- Weechat::Bar
- Extended by:
- Properties
- Includes:
- Pointer
- Defined in:
- lib/weechat/bar.rb
Defined Under Namespace
Classes: Item
Instance Attribute Summary
Attributes included from Pointer
Class Method Summary collapse
- .find(name) ⇒ Object (also: from_name)
Instance Method Summary collapse
- #delete ⇒ Object (also: #remove)
-
#initialize(args = {}) ⇒ Bar
constructor
eigenclass.
- #update ⇒ Object
Methods included from Properties::ClassMethods
#all, #apply_rtransformation, #apply_transformation, #init_properties, #known_integer_properties, #known_properties, #known_string_properties, #mappings, #rtransformations, #settable_properties, #transformations, #type
Methods included from Pointer
#==, #hash, included, #inspect, #to_s
Constructor Details
#initialize(args = {}) ⇒ Bar
eigenclass
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/weechat/bar.rb', line 139 def initialize(args = {}) mapped_args = {} args.each do |key, value| mapped_args[key] = self.class.apply_rtransformation(key, value) end @ptr = Weechat.(*mapped_args.values_at(:name, :hidden, :priority, :type, :condition, :position, :filling_top_bottom, :filling_left_right, :size, :size_max, :color_fg, :color_delim, :color_bg, :separator, :items)) if @ptr.empty? raise "Could not create bar" end @name = args[:name] end |
Class Method Details
.find(name) ⇒ Object Also known as: from_name
128 129 130 131 132 133 134 135 |
# File 'lib/weechat/bar.rb', line 128 def find(name) ptr = Weechat.(name) if !ptr.empty? from_ptr(ptr) else nil end end |