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
-
#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.
- #style? ⇒ Boolean private
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
#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).
54 55 56 |
# File 'lib/vedeu/presentation/styles.rb', line 54 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.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vedeu/presentation/styles.rb', line 21 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.
38 39 40 |
# File 'lib/vedeu/presentation/styles.rb', line 38 def style=(value) @_style = @style = Vedeu::Presentation::Style.coerce(value) end |
#style? ⇒ Boolean
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.
43 44 45 |
# File 'lib/vedeu/presentation/styles.rb', line 43 def style? present?(@style) end |