Class: RSpec::Junklet::Formatter
- Inherits:
-
Object
- Object
- RSpec::Junklet::Formatter
- Defined in:
- lib/rspec/junklet/formatter.rb
Overview
Formatter.new(input) receives the generated junk, and #format returns the input already formatted. You don’t have to inherit from this class; as long as your class accepts one argument to .new and responds to #format you’re a formatter. Inheriting from Formatter means you already have a basic implementation, however.
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Instance Method Summary collapse
-
#format ⇒ Object
You probably want to override this.
-
#initialize(input) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(input) ⇒ Formatter
Returns a new instance of Formatter.
11 12 13 |
# File 'lib/rspec/junklet/formatter.rb', line 11 def initialize(input) @input = input end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
9 10 11 |
# File 'lib/rspec/junklet/formatter.rb', line 9 def input @input end |
Instance Method Details
#format ⇒ Object
You probably want to override this
16 17 18 |
# File 'lib/rspec/junklet/formatter.rb', line 16 def format input end |