Sha256: 84ee85778c369fe471eb0cd9b827091fb565943bf13e112836b0a1eb42e91bb6

Contents?: true

Size: 452 Bytes

Versions: 3

Compression:

Stored size: 452 Bytes

Contents

module DissociatedIntrospection
  class RubyClass
    class CreateDef
      attr_reader :ast, :comments

      def initialize(ast, comments)
        @ast      = ast
        @comments = comments
      end

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dissociated_introspection-0.13.0 lib/dissociated_introspection/ruby_class/create_def.rb
dissociated_introspection-0.12.0 lib/dissociated_introspection/ruby_class/create_def.rb
dissociated_introspection-0.11.0 lib/dissociated_introspection/ruby_class/create_def.rb