Class: Shul::Window

Inherits:
Object
  • Object
show all
Defined in:
lib/shul.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shoes, doc) ⇒ Window

Returns a new instance of Window.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/shul.rb', line 136

def initialize(shoes, doc)
  
  @shoes = shoes
  @width, @height = 100, 100
  
  @doc = doc

  @doc.root.elements.each {|x| method(x.name.sub(':','_').to_sym).call(x) }

  def @doc.element_by_id(id)
    self.root.element("//*[@id='#{id}']")
  end

end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



134
135
136
# File 'lib/shul.rb', line 134

def height
  @height
end

#widthObject (readonly)

Returns the value of attribute width.



134
135
136
# File 'lib/shul.rb', line 134

def width
  @width
end

Class Method Details

.element_by_id(id) ⇒ Object



145
146
147
# File 'lib/shul.rb', line 145

def @doc.element_by_id(id)
  self.root.element("//*[@id='#{id}']")
end