Class: Warp::Dir::Formatter::PointFormatter
- Defined in:
- lib/warp/dir/formatter.rb
Instance Attribute Summary collapse
-
#point ⇒ Object
Returns the value of attribute point.
Instance Method Summary collapse
- #format(type = DEFAULT_FORMAT, width = 0) ⇒ Object
-
#initialize(point) ⇒ PointFormatter
constructor
A new instance of PointFormatter.
Constructor Details
#initialize(point) ⇒ PointFormatter
Returns a new instance of PointFormatter.
41 42 43 |
# File 'lib/warp/dir/formatter.rb', line 41 def initialize(point) @point = point end |
Instance Attribute Details
#point ⇒ Object
Returns the value of attribute point.
39 40 41 |
# File 'lib/warp/dir/formatter.rb', line 39 def point @point end |
Instance Method Details
#format(type = DEFAULT_FORMAT, width = 0) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/warp/dir/formatter.rb', line 45 def format(type = DEFAULT_FORMAT, width = 0) case type when :ascii point.to_s(width) else raise ArgumentError.new("Type #{type} is not recognized.") end end |