Browse Source

Evaluate strings

master
Dylan Baker 5 years ago
parent
commit
f31ce80c4b
2 changed files with 11 additions and 0 deletions
  1. 4
    0
      lib/chervil/ast/string.rb
  2. 7
    0
      spec/ast/string_spec.rb

+ 4
- 0
lib/chervil/ast/string.rb View File

@@ -9,5 +9,9 @@ module Chervil::AST
9 9
     def ==(other)
10 10
       @value == other.value
11 11
     end
12
+
13
+    def evaluate
14
+      @value
15
+    end
12 16
   end
13 17
 end

+ 7
- 0
spec/ast/string_spec.rb View File

@@ -0,0 +1,7 @@
1
+module Chervil::AST
2
+  RSpec.describe String do
3
+    it 'evaluates' do
4
+      expect(String.new("hello world").evaluate).to eq("hello world")
5
+    end
6
+  end
7
+end

Loading…
Cancel
Save