Class: Shoes::TextBlockElement
- Inherits:
-
TextElement
- Object
- TextElement
- Shoes::TextBlockElement
- Defined in:
- lib/shoes/mocks/mocked_classes.rb
Overview
quite an inheritance chain… someone told me inheritance is bad :< But it felt like so much duplication
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#parent ⇒ Object
Returns the value of attribute parent.
Attributes inherited from TextElement
Instance Method Summary collapse
- #click ⇒ Object
-
#initialize(parent, text, &blk) ⇒ TextBlockElement
constructor
A new instance of TextBlockElement.
Constructor Details
#initialize(parent, text, &blk) ⇒ TextBlockElement
Returns a new instance of TextBlockElement.
15 16 17 18 19 |
# File 'lib/shoes/mocks/mocked_classes.rb', line 15 def initialize(parent, text, &blk) super(text) self.parent = parent self.block = blk end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
14 15 16 |
# File 'lib/shoes/mocks/mocked_classes.rb', line 14 def block @block end |
#parent ⇒ Object
Returns the value of attribute parent.
14 15 16 |
# File 'lib/shoes/mocks/mocked_classes.rb', line 14 def parent @parent end |
Instance Method Details
#click ⇒ Object
21 22 23 |
# File 'lib/shoes/mocks/mocked_classes.rb', line 21 def click parent.instance_eval(&block) end |