Class: XlibObj::Screen::Crtc::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/screen/crtc/output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(crtc, id) ⇒ Output

Returns a new instance of Output.



13
14
15
16
17
18
19
20
# File 'lib/screen/crtc/output.rb', line 13

def initialize(crtc, id)
  @crtc = crtc
  @id = id

  ObjectSpace.define_finalizer(self) do
    Xlib.XRRFreeOutputInfo(@attributes.pointer) if @attributes
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



29
30
31
# File 'lib/screen/crtc/output.rb', line 29

def method_missing(name)
  attribute(name)
end

Instance Attribute Details

#crtcObject (readonly)

Returns the value of attribute crtc.



22
23
24
# File 'lib/screen/crtc/output.rb', line 22

def crtc
  @crtc
end

#idObject (readonly)

Returns the value of attribute id.



22
23
24
# File 'lib/screen/crtc/output.rb', line 22

def id
  @id
end

Instance Method Details

#attribute(attribute) ⇒ Object



24
25
26
27
# File 'lib/screen/crtc/output.rb', line 24

def attribute(attribute)
  return unless attributes.layout.members.include? attribute.to_sym
  attributes[attribute.to_sym]
end