lib/vedeu/models/stream.rb in vedeu-0.1.17 vs lib/vedeu/models/stream.rb in vedeu-0.1.18
- old
+ new
@@ -33,35 +33,45 @@
[ colour, style, data ].join
end
private
+ # @api private
+ # @return [String]
def data
width? ? aligned : text
end
+ # @api private
+ # @return [String]
def aligned
case align
when :right then text.rjust(width, ' ')
when :centre then text.center(width, ' ')
else text.ljust(width, ' ')
end
end
+ # @api private
+ # @return [TrueClass|FalseClass]
def width?
!!width
end
+ # @api private
+ # @return [Hash]
def defaults
{
colour: {},
style: [],
text: '',
width: nil,
align: :left
}
end
+ # @api private
+ # @return []
def method_missing(method, *args, &block)
@self_before_instance_eval.send(method, *args, &block)
end
end