Sha256: b307e3e62556e1887b3bfce09cfc5a76094bbcfa85f0a3a2034108b3fc3fadef
Contents?: true
Size: 840 Bytes
Versions: 1
Compression:
Stored size: 840 Bytes
Contents
module Pelusa module Lint class Properties def initialize @violations = Set.new end def check(klass) iterate_lines!(klass) return SuccessfulAnalysis.new(name) if @violations.empty? FailedAnalysis.new(name, @violations) do |violations| "There are getters, setters or properties in lines #{violations.to_a.join(', ')}" end end private def name "Doesn't use getters, setters or properties" end def iterate_lines!(klass) ClassAnalyzer.walk(klass) do |node| if node.is_a?(Rubinius::ToolSets::Runtime::ToolSet::AST::Send) if [:attr_accessor, :attr_writer, :attr_reader].include? node.name @violations << node.line end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pelusa-0.2.4 | lib/pelusa/lint/properties.rb |