Class: Vedeu::Views::Stream Private
- Inherits:
-
Object
- Object
- Vedeu::Views::Stream
- Extended by:
- Forwardable
- Includes:
- Presentation, Presentation::Colour, Presentation::Parent, Presentation::Position, Presentation::Styles, Repositories::Model, DefaultAttributes, Value
- Defined in:
- lib/vedeu/views/stream.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents a character or collection of characters as part of a Line which you wish to colour and style independently of the other characters in that line.
Defined Under Namespace
Classes: DSL
Instance Attribute Summary collapse
- #value ⇒ String (also: #chars=) writeonly private
Attributes included from Repositories::Model
Attributes included from DefaultAttributes
#align, #pad, #truncate, #width, #wordwrap
Instance Method Summary collapse
-
#add(child) ⇒ Vedeu::Views::Streams
(also: #<<)
private
Adds the child to the collection.
-
#eql?(other) ⇒ Boolean
(also: #==)
private
An object is equal when its values are the same.
-
#initialize(attributes = {}) ⇒ Vedeu::Views::Stream
constructor
private
Returns a new instance of Vedeu::Views::Stream.
Methods included from Value
Methods included from Presentation::Styles
#render_style, #style, #style=, #style?
Methods included from Presentation::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?
Methods included from Presentation::Position
#position, #position=, #position?, #render_position, #x, #y
Methods included from Presentation::Colour
#background, #background=, #colour, #colour=, #colour?, #foreground, #foreground=, #interface, #named_colour, #named_colour?, #parent_colour, #parent_colour?, #render_colour
Methods included from Presentation
Methods included from Repositories::Model
Methods included from DefaultAttributes
Methods included from Repositories::Defaults
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::Views::Stream
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.
Returns a new instance of Vedeu::Views::Stream.
67 68 69 70 71 |
# File 'lib/vedeu/views/stream.rb', line 67 def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#value=(value) ⇒ String (writeonly) Also known as: chars=
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.
55 56 57 |
# File 'lib/vedeu/views/stream.rb', line 55 def value=(value) @value = value end |
Instance Method Details
#add(child) ⇒ Vedeu::Views::Streams Also known as: <<
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.
Adds the child to the collection.
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/vedeu/views/stream.rb', line 77 def add(child) if defined?(parent) && present?(parent) parent.add(child) else @value = child self end end |
#eql?(other) ⇒ Boolean Also known as: ==
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.
An object is equal when its values are the same.
93 94 95 |
# File 'lib/vedeu/views/stream.rb', line 93 def eql?(other) self.class.equal?(other.class) && value == other.value end |