Navigation Menu

Skip to content

Commit

Permalink
only backport the to_d method if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 24, 2011
1 parent 4af4312 commit bac5da3
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -29,8 +29,11 @@ def encode_with(coder)
coder.represent_scalar(nil, YAML_MAPPING[string] || string)
end

def to_d
self
# Backport this method if it doesn't exist
unless method_defined?(:to_d)
def to_d
self
end
end

DEFAULT_STRING_FORMAT = 'F'
Expand Down

0 comments on commit bac5da3

Please sign in to comment.