Method: Screen#initialize

Defined in:
lib/icuke/screen.rb

#initialize(xml) ⇒ Screen

Returns a new instance of Screen.



6
7
8
9
10
11
# File 'lib/icuke/screen.rb', line 6

def initialize(xml)
  @xml = Nokogiri::XML::Document.parse(xml).root
  frame = @xml.at_xpath('/screen/frame')
  @x, @y = frame['x'].to_f, frame['y'].to_f
  @width, @height = frame['width'].to_f, frame['height'].to_f
end