Class: Weechat::Bar::Item
- Inherits:
-
Object
- Object
- Weechat::Bar::Item
- Extended by:
- Callbacks, Properties
- Includes:
- Pointer
- Defined in:
- lib/weechat/bar.rb
Instance Attribute Summary
Attributes included from Pointer
Class Method Summary collapse
- .call_build_callback(id, window) ⇒ Object
- .find(name) ⇒ Object (also: from_name)
- .items ⇒ Object (also: all)
Instance Method Summary collapse
- #delete ⇒ Object (also: #remove)
-
#initialize(name, &build_callback) ⇒ Item
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 Callbacks
call_callback, callbacks, compute_free_id, compute_free_id, register_callback, unique_id
Methods included from Pointer
#==, #hash, included, #inspect, #to_s
Constructor Details
#initialize(name, &build_callback) ⇒ Item
eigenclass
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/weechat/bar.rb', line 40 def initialize(name, &build_callback) id = self.class.compute_free_id @ptr = Weechat.(name, "bar_build_callback", id.to_s) if @ptr.empty? raise "Could not create bar item" end self.class.register_callback( :build_callback => Callback.new(build_callback), :ptr => @ptr ) end |
Class Method Details
.call_build_callback(id, window) ⇒ Object
64 65 66 67 |
# File 'lib/weechat/bar.rb', line 64 def call_build_callback(id, window) window = Window.from_ptr(window) call_callback(id, :build_callback, window).to_s end |
.find(name) ⇒ Object Also known as: from_name
29 30 31 32 33 34 35 36 |
# File 'lib/weechat/bar.rb', line 29 def find(name) ptr = Weechat.(name) if !ptr.empty? from_ptr(ptr) else nil end end |