Class: MarkdownExpander::Expander::Expression
- Inherits:
-
Object
- Object
- MarkdownExpander::Expander::Expression
- Defined in:
- lib/markdown_expander/expander.rb
Instance Method Summary collapse
- #evaluate(scope) ⇒ Object
-
#initialize(value) ⇒ Expression
constructor
A new instance of Expression.
Constructor Details
#initialize(value) ⇒ Expression
Returns a new instance of Expression.
79 80 81 |
# File 'lib/markdown_expander/expander.rb', line 79 def initialize value @value = value end |
Instance Method Details
#evaluate(scope) ⇒ Object
82 83 84 85 86 87 88 89 |
# File 'lib/markdown_expander/expander.rb', line 82 def evaluate scope parts = @value.split(".") current_scope = scope parts.each do |part| current_scope = current_scope[part.to_sym] end current_scope end |