Class: Vedeu::API::Stream
- Includes:
- Helpers
- Defined in:
- lib/vedeu/api/stream.rb
Instance Attribute Summary
Attributes inherited from Stream
Instance Method Summary collapse
-
#align(value) ⇒ Symbol
Specify the alignment of the stream within the line.
-
#text(value) ⇒ String
Add textual data to the stream via this method.
-
#width(value) ⇒ Fixnum
Provides the ability to arbitrarily set the width of content for a stream.
Methods included from Helpers
Methods inherited from Stream
#aligned, build, #data, #defaults, #initialize, #method_missing, #to_s, #width?
Methods included from Presentation
Methods included from Coercions
Constructor Details
This class inherits a constructor from Vedeu::Stream
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Vedeu::Stream
Instance Method Details
#align(value) ⇒ Symbol
Specify the alignment of the stream within the line. Useful in combination with #width to provide simple formatting effects.
21 22 23 24 25 26 27 28 |
# File 'lib/vedeu/api/stream.rb', line 21 def align(value) unless [:left, :right, :centre].include?(value.to_sym) fail InvalidSyntax, '`align` requires a value of `:left`, `:right` ' \ 'or `centre`.' end attributes[:align] = value.to_sym end |
#text(value) ⇒ String
Add textual data to the stream via this method.
44 45 46 |
# File 'lib/vedeu/api/stream.rb', line 44 def text(value) attributes[:text] = value end |
#width(value) ⇒ Fixnum
Provides the ability to arbitrarily set the width of content for a stream. Useful in combination with #align to provide simple formatting effects.
62 63 64 |
# File 'lib/vedeu/api/stream.rb', line 62 def width(value) attributes[:width] = value end |