Module: Vedeu::Presentation::Styles Private
- Included in:
- Borders::Border, Cells::Empty, Interfaces::Interface, Interfaces::Null, Output::Write, Views::Composition, Views::Line, Views::Stream, Views::View
- Defined in:
- lib/vedeu/presentation/styles.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Provides style related presentation behaviour.
Instance Method Summary collapse
- #name ⇒ NilClass|String|Symbol private
-
#render_style(&block) ⇒ String
private
private
Renders the style attributes of the receiver and yields (to then render the next model, or finally, the content).
-
#style ⇒ Vedeu::Presentation::Style
private
When the style for the model exists, return it, otherwise returns the parent style, or an empty Style.
-
#style=(value) ⇒ Vedeu::Presentation::Style
private
Allows the setting of the style by coercing the given value into a Style.
Methods included from Parent
Methods included from Common
#absent?, #array?, #boolean, #boolean?, #empty_value?, #escape?, #falsy?, #hash?, #line_model?, #numeric?, #positionable?, #present?, #snake_case, #stream_model?, #string?, #symbol?, #truthy?, #view_model?
Instance Method Details
#name ⇒ NilClass|String|Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 20 21 22 23 24 25 |
# File 'lib/vedeu/presentation/styles.rb', line 17 def name if present?(@name) @name elsif parent && present?(parent.name) parent.name end end |
#render_style(&block) ⇒ String (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Renders the style attributes of the receiver and yields (to then render the next model, or finally, the content).
60 61 62 |
# File 'lib/vedeu/presentation/styles.rb', line 60 def render_style(&block) "#{style}#{yield}" end |
#style ⇒ Vedeu::Presentation::Style
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
When the style for the model exists, return it, otherwise returns the parent style, or an empty Vedeu::Presentation::Style.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/vedeu/presentation/styles.rb', line 32 def style @_style ||= if @style Vedeu::Presentation::Style.coerce(@style) elsif parent && present?(parent.style) Vedeu::Presentation::Style.coerce(parent.style) else Vedeu::Presentation::Style.new end end |
#style=(value) ⇒ Vedeu::Presentation::Style
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Allows the setting of the style by coercing the given value into a Vedeu::Presentation::Style.
49 50 51 |
# File 'lib/vedeu/presentation/styles.rb', line 49 def style=(value) @_style = @style = Vedeu::Presentation::Style.coerce(value) end |