Class: MarkdownExpander::Expander::Expression
- Inherits:
-
Object
- Object
- MarkdownExpander::Expander::Expression
- Defined in:
- lib/markdown-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.
84 85 86 |
# File 'lib/markdown-expander.rb', line 84 def initialize value @value = value end |
Instance Method Details
#evaluate(scope) ⇒ Object
87 88 89 90 91 92 93 94 |
# File 'lib/markdown-expander.rb', line 87 def evaluate scope parts = @value.split(".") current_scope = scope parts.each do |part| current_scope = current_scope[part.to_sym] end current_scope end |