Class: Seafoam::Formatters::Text::SourceFormatter

Inherits:
Base::SourceFormatter show all
Defined in:
lib/seafoam/formatters/text.rb

Overview

A plain-text formatter for the ‘source` command.

Instance Attribute Summary

Attributes inherited from Base::SourceFormatter

#source_position

Instance Method Summary collapse

Methods inherited from Base::SourceFormatter

#initialize

Constructor Details

This class inherits a constructor from Seafoam::Formatters::Base::SourceFormatter

Instance Method Details

#formatObject



62
63
64
# File 'lib/seafoam/formatters/text.rb', line 62

def format
  Seafoam::Graal::Source.walk(source_position, &method(:render_method)).join("\n")
end

#render_method(method) ⇒ Object



66
67
68
69
70
# File 'lib/seafoam/formatters/text.rb', line 66

def render_method(method)
  declaring_class = method[:declaring_class]
  name = method[:method_name]
  "#{declaring_class}##{name}"
end