class DissociatedIntrospection::RubyClass::CreateDef
Attributes
ast[R]
comments[R]
Public Class Methods
new(ast, comments)
click to toggle source
# File lib/dissociated_introspection/ruby_class/create_def.rb, line 6 def initialize(ast, comments) @ast = ast @comments = comments end
Public Instance Methods
create()
click to toggle source
# File lib/dissociated_introspection/ruby_class/create_def.rb, line 11 def create def_comments = comments.select do |comment| comment.location.last_line + 1 == ast.location.first_line end Def.new(RubyCode.build_from_ast(ast, comments: def_comments)) end