Method: Lines::Dumper#map
- Defined in:
- lib/lines.rb
#map(klass, &rule) ⇒ Object
Used to introduce new ruby litterals.
Usage:
Point = Struct.new(:x, :y)
Lines.dumper.map(Point) do |p|
"#{p.x}x#{p.y}"
end
Lines.log msg: Point.new(3, 5)
# logs: msg=3x5
279 280 281 |
# File 'lib/lines.rb', line 279 def map(klass, &rule) @mapping[klass] = rule end |