Class: XlibObj::Atom
- Inherits:
-
Object
- Object
- XlibObj::Atom
- Defined in:
- lib/atom.rb
Instance Attribute Summary collapse
-
#to_native ⇒ Object
readonly
Returns the value of attribute to_native.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(display, atom) ⇒ Atom
constructor
A new instance of Atom.
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(display, atom) ⇒ Atom
Returns a new instance of Atom.
11 12 13 14 15 16 17 18 |
# File 'lib/atom.rb', line 11 def initialize(display, atom) @display = display @to_native = if atom.is_a? Integer atom else Xlib.XInternAtom(@display.to_native, atom.to_s, false) end end |
Instance Attribute Details
#to_native ⇒ Object (readonly)
Returns the value of attribute to_native.
20 21 22 |
# File 'lib/atom.rb', line 20 def to_native @to_native end |
Instance Method Details
#exists? ⇒ Boolean
26 27 28 |
# File 'lib/atom.rb', line 26 def exists? @to_native != 0 end |
#name ⇒ Object
22 23 24 |
# File 'lib/atom.rb', line 22 def name Xlib.XGetAtomName(@display.to_native, @to_native).to_sym end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/atom.rb', line 30 def to_s name.to_s end |