Class: Vedeu::Views::View Private
- Inherits:
-
Object
- Object
- Vedeu::Views::View
- Extended by:
- Forwardable
- Includes:
- Presentation, Presentation::Colour, Presentation::Parent, Presentation::Position, Presentation::Styles, Repositories::Model, Value
- Defined in:
- lib/vedeu/views/view.rb
Overview
Defined Under Namespace
Classes: DSL
Instance Attribute Summary collapse
- #cursor_visible ⇒ Boolean (also: #cursor_visible?)
- #name ⇒ NilClass|String|Symbol private
- #wordwrap ⇒ Boolean (also: #wordwrap?)
- #zindex ⇒ Fixnum
Attributes included from Repositories::Model
Instance Method Summary collapse
-
#add(child) ⇒ Vedeu::Views::Lines
(also: #<<)
private
Adds the child to the collection.
- #attributes ⇒ Hash private
-
#buffer ⇒ Vedeu::Buffers::Buffer
private
private
Returns the named buffer from the buffer repository.
-
#defaults ⇒ Hash<Symbol => void>
private
private
The default options/attributes for a new instance of this class.
-
#initialize(attributes = {}) ⇒ Vedeu::Views::View
constructor
private
Return a new instance of Vedeu::Views::View.
-
#interface ⇒ Vedeu::Interfaces::Interface
private
private
Returns the named interface/view from the interfaces repository.
-
#update_buffer(refresh = false) ⇒ Vedeu::Views::View
private
Store the view in its respective buffer.
-
#visible? ⇒ Boolean
private
Returns a boolean indicating whether the view is visible.
Methods included from Value
Methods included from Presentation::Styles
#render_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=, #named_colour, #named_colour?, #parent_colour, #parent_colour?, #render_colour
Methods included from Presentation
Methods included from Repositories::Model
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::Views::View
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.
Return a new instance of Vedeu::Views::View.
81 82 83 84 85 |
# File 'lib/vedeu/views/view.rb', line 81 def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#cursor_visible ⇒ Boolean Also known as: cursor_visible?
52 53 54 |
# File 'lib/vedeu/views/view.rb', line 52 def cursor_visible @cursor_visible end |
#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.
57 58 59 |
# File 'lib/vedeu/views/view.rb', line 57 def name @name end |
#wordwrap ⇒ Boolean Also known as: wordwrap?
61 62 63 |
# File 'lib/vedeu/views/view.rb', line 61 def wordwrap @wordwrap end |
#zindex ⇒ Fixnum
66 67 68 |
# File 'lib/vedeu/views/view.rb', line 66 def zindex @zindex end |
Instance Method Details
#add(child) ⇒ Vedeu::Views::Lines 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.
91 92 93 |
# File 'lib/vedeu/views/view.rb', line 91 def add(child) @value = value.add(child) end |
#attributes ⇒ Hash
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.
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/vedeu/views/view.rb', line 97 def attributes { client: client, colour: colour, cursor_visible: cursor_visible, name: name, parent: parent, style: style, value: value, wordwrap: wordwrap, zindex: zindex, } end |
#buffer ⇒ Vedeu::Buffers::Buffer (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.
Returns the named buffer from the buffer repository.
147 148 149 |
# File 'lib/vedeu/views/view.rb', line 147 def buffer Vedeu.buffers.by_name(name) end |
#defaults ⇒ Hash<Symbol => void> (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.
The default options/attributes for a new instance of this class.
152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/vedeu/views/view.rb', line 152 def defaults { client: nil, colour: Vedeu.config.colour, cursor_visible: true, name: nil, parent: nil, style: :normal, value: [], wordwrap: true, zindex: 0, } end |
#interface ⇒ Vedeu::Interfaces::Interface (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.
Returns the named interface/view from the interfaces repository.
167 168 169 |
# File 'lib/vedeu/views/view.rb', line 167 def interface Vedeu.interfaces.by_name(name) end |
#update_buffer(refresh = false) ⇒ Vedeu::Views::View
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.
Store the view in its respective buffer.
128 129 130 131 132 133 134 135 |
# File 'lib/vedeu/views/view.rb', line 128 def update_buffer(refresh = false) raise Vedeu::Error::MissingRequired, 'Cannot store a view without a name.' unless present?(name) buffer.add(self, refresh) self end |
#visible? ⇒ 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.
Returns a boolean indicating whether the view is visible.
140 141 142 |
# File 'lib/vedeu/views/view.rb', line 140 def visible? interface.visible? end |