lib/ecoportal/api/graphql/fragment.rb in ecoportal-api-graphql-0.3.5 vs lib/ecoportal/api/graphql/fragment.rb in ecoportal-api-graphql-0.3.6
- old
+ new
@@ -25,10 +25,10 @@
@client = client
parse
end
def define(sym, heredoc, namespace: ::Fragment)
- namespace.send(:remove_const, sym) if namespace.const?(sym)
+ namespace.send(:remove_const, sym) if namespace.const_defined?(sym)
client.parse(heredoc).tap do |fragment|
namespace.const_set(sym, fragment)
::Fragment.const_set(sym, fragment) unless namespace == ::Fragment
end
end