Class: Reek::Source

Inherits:
Object show all
Defined in:
lib/reek/adapters/source.rb

Overview

A Source object represents a chunk of Ruby source code.

Direct Known Subclasses

ObjectSource, SourceFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, desc) ⇒ Source

Returns a new instance of Source.



12
13
14
15
# File 'lib/reek/adapters/source.rb', line 12

def initialize(code, desc)
  @source = code
  @desc = desc
end

Instance Attribute Details

#descObject (readonly)

Returns the value of attribute desc.



10
11
12
# File 'lib/reek/adapters/source.rb', line 10

def desc
  @desc
end

Instance Method Details

#configure(sniffer) ⇒ Object



17
# File 'lib/reek/adapters/source.rb', line 17

def configure(sniffer) end

#syntax_treeObject



19
20
21
# File 'lib/reek/adapters/source.rb', line 19

def syntax_tree
  RubyParser.new.parse(@source, @desc) || s()
end