lib/steep/interface/abstract.rb in steep-0.8.2 vs lib/steep/interface/abstract.rb in steep-0.9.0
- old
+ new
@@ -37,8 +37,32 @@
type: type,
methods: methods.transform_values {|method| method.subst(subst) },
ivar_chains: ivar_chains.transform_values {|chain| chain.subst(subst) }
)
end
+
+ def without_private(option)
+ if option
+ self.class.new(
+ name: name,
+ params: params,
+ methods: methods.reject {|_, method| method.private? },
+ supers: supers,
+ ivar_chains: ivar_chains
+ )
+ else
+ self
+ end
+ end
+
+ def without_initialize
+ self.class.new(
+ name: name,
+ params: params,
+ methods: methods.reject {|_, method| method.name == :initialize },
+ supers: supers,
+ ivar_chains: ivar_chains
+ )
+ end
end
end
end