Class: Shul::Window
- Inherits:
-
Object
- Object
- Shul::Window
- Defined in:
- lib/shul.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(shoes, doc) ⇒ Window
constructor
A new instance of Window.
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
#height ⇒ Object (readonly)
Returns the value of attribute height.
134 135 136 |
# File 'lib/shul.rb', line 134 def height @height end |
#width ⇒ Object (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 |