Class: Docbert::Converters::StepDefinitions::ParameterizedContent
- Inherits:
-
Object
- Object
- Docbert::Converters::StepDefinitions::ParameterizedContent
- Defined in:
- lib/docbert/converters/step_definitions/parameterized_content.rb
Instance Method Summary collapse
-
#initialize(el, &block) ⇒ ParameterizedContent
constructor
A new instance of ParameterizedContent.
- #params ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(el, &block) ⇒ ParameterizedContent
Returns a new instance of ParameterizedContent.
5 6 7 8 |
# File 'lib/docbert/converters/step_definitions/parameterized_content.rb', line 5 def initialize(el, &block) self.el = el self.block = block end |
Instance Method Details
#params ⇒ Object
10 11 12 13 14 15 |
# File 'lib/docbert/converters/step_definitions/parameterized_content.rb', line 10 def params @params ||= el. children. select { |e| param?(e) }. map { |e| param(e) } end |
#to_s ⇒ Object
17 18 19 20 21 22 |
# File 'lib/docbert/converters/step_definitions/parameterized_content.rb', line 17 def to_s @s ||= el. children. map { |e| param?(e) ? block.(param(e)) : e.value }. join end |