lib/analyst/entities/method_call.rb in analyst-0.14.2 vs lib/analyst/entities/method_call.rb in analyst-0.15.0

- old
+ new

@@ -1,9 +1,11 @@ module Analyst module Entities class MethodCall < Entity + handles_node :send + def name name_node.to_s end def full_name @@ -11,20 +13,34 @@ end def arguments @arguments ||= begin args = ast.children[2..-1] - args.map { |arg| Analyst::Parser.process_node(arg, self) } + args.map { |arg| process_node(arg) } end end - # TODO: figure out how to resolve this to an Entity. we never want - # to expose the AST to the outside. + def constants + if target.is_a? Analyst::Entities::Constant + super << target + else + super + end + end + + private + + def contents + arguments + end + def target_node ast.children.first end - private + def target + process_node(target_node) + end def name_node ast.children[1] end