ruby-x11/lib/X11/screen.rb
Richard Ramsden 736e4d179b use OpenStruct instead of returning a hash value
When we created a Packet object before using
Packet.read would return a hash. Instead, return
an OpenStruct object which makes accessing
parameters easier
2012-05-19 13:14:47 -07:00

22 lines
348 B
Ruby

module X11
class Screen
attr_reader :display
def initialize(display, data)
@display = display
@internal = data
end
def width
@internal.width_in_pixels
end
def height
@internal.height_in_pixels
end
def to_s
"#<X11::Screen(#{id}) width=#{width} height=#{height}>"
end
end
end