Skip to content

Instantly share code, notes, and snippets.

@cored
Created July 17, 2013 22:22
Show Gist options
  • Save cored/6025076 to your computer and use it in GitHub Desktop.
Save cored/6025076 to your computer and use it in GitHub Desktop.
def self.infer_type(operand)
if operand.respond_to?(:type)
operand.type
else
Types::Type.descendants.detect { |type| type.include?(operand) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment