瀏覽代碼

Evaluate strings

master
Dylan Baker 5 年之前
父節點
當前提交
f31ce80c4b
共有 2 個文件被更改,包括 11 次插入0 次删除
  1. 4
    0
      lib/chervil/ast/string.rb
  2. 7
    0
      spec/ast/string_spec.rb

+ 4
- 0
lib/chervil/ast/string.rb 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存