Skip to content

Commit

Permalink
Add support to Ruby 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
brennovich authored and albus522 committed Sep 23, 2014
1 parent 78dac01 commit 9babdf3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/delayed/psych_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ def self.load yaml, filename = nil, visitor = nil

module Nodes
class Node
def to_ruby(visitor)
visitor ||= Visitors::ToRuby
visitor.new.accept(self)
if Gem::Version.new(VERSION) >= Gem::Version.new('2.0.2')
def to_ruby(visitor)
visitor ||= Visitors::ToRuby
visitor.create.accept(self)
end
else
def to_ruby(visitor)
visitor ||= Visitors::ToRuby
visitor.new.accept(self)
end
end
end
end
Expand Down

0 comments on commit 9babdf3

Please sign in to comment.