Module: Vedeu::DSL::Presentation
Overview
Instance Method Summary collapse
-
#background(value = '') ⇒ String
(also: #bg, #bgcolor)
Define the background colour for an interface, line, or a stream.
-
#colour(attributes = {}) ⇒ Vedeu::Colour
Define either or both foreground and background colours for an interface, line or a stream.
- #foreground(value = '') ⇒ Object (also: #fg, #fgcolor)
-
#style(value) ⇒ Vedeu::Style
(also: #styles)
Define a style or styles for an interface, line or a stream.
Instance Method Details
#background(value = '') ⇒ String Also known as: bg, bgcolor
The last defined background colour for a particular interface, line or stream overrides previously defined entries in the same block.
Define the background colour for an interface, line, or a stream. When called with a block, will create a new stream with the background colour specified. When the block terminates, the background will return to that of the parent.
38 39 40 |
# File 'lib/vedeu/dsl/shared/presentation.rb', line 38 def background(value = '') colour(background: value) end |
#colour(attributes = {}) ⇒ Vedeu::Colour
Rejects invalid keys and empty/nil attributes. Also, the last defined colour for a particular interface, line or stream overrides previously defined entries in the same block.
Define either or both foreground and background colours for an interface, line or a stream. At least one attribute is required.
74 75 76 77 78 79 |
# File 'lib/vedeu/dsl/shared/presentation.rb', line 74 def colour(attributes = {}) attributes.delete_if do |k, v| [:background, :foreground].include?(k) == false || v.nil? || v.empty? end model.colour = Vedeu::Colour.coerce(attributes) end |
#foreground(value = '') ⇒ Object Also known as: fg, fgcolor
45 46 47 |
# File 'lib/vedeu/dsl/shared/presentation.rb', line 45 def foreground(value = '') colour(foreground: value) end |
#style(value) ⇒ Vedeu::Style Also known as: styles
Define a style or styles for an interface, line or a stream.
99 100 101 |
# File 'lib/vedeu/dsl/shared/presentation.rb', line 99 def style(value) model.style = Vedeu::Style.coerce(value) end |