Class: XlibObj::Screen::Crtc
- Inherits:
-
Object
- Object
- XlibObj::Screen::Crtc
- Defined in:
- lib/screen/crtc.rb,
lib/screen/crtc/output.rb
Defined Under Namespace
Classes: Output
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#screen ⇒ Object
readonly
Returns the value of attribute screen.
Instance Method Summary collapse
- #attribute(attribute) ⇒ Object
-
#initialize(screen, id) ⇒ Crtc
constructor
A new instance of Crtc.
- #method_missing(name) ⇒ Object
- #outputs ⇒ Object
Constructor Details
#initialize(screen, id) ⇒ Crtc
Returns a new instance of Crtc.
12 13 14 15 16 17 18 19 |
# File 'lib/screen/crtc.rb', line 12 def initialize(screen, id) @screen = screen @id = id ObjectSpace.define_finalizer(self) do Xlib.XRRFreeCrtcInfo(@attributes.pointer) if @attributes end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
28 29 30 |
# File 'lib/screen/crtc.rb', line 28 def method_missing(name) attribute(name) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
21 22 23 |
# File 'lib/screen/crtc.rb', line 21 def id @id end |
#screen ⇒ Object (readonly)
Returns the value of attribute screen.
21 22 23 |
# File 'lib/screen/crtc.rb', line 21 def screen @screen end |
Instance Method Details
#attribute(attribute) ⇒ Object
23 24 25 26 |
# File 'lib/screen/crtc.rb', line 23 def attribute(attribute) return unless attributes.layout.members.include? attribute.to_sym attributes[attribute.to_sym] end |