Class: Vedeu::Groups::Refresh
- Inherits:
-
Object
- Object
- Vedeu::Groups::Refresh
- Includes:
- Common
- Defined in:
- lib/vedeu/groups/refresh.rb
Overview
Refresh an interface, or collection of interfaces belonging to a group.
The interfaces will be refreshed in z-index order, meaning that interfaces with a lower z-index will be drawn first. This means overlapping interfaces will be drawn as specified.
Instance Attribute Summary collapse
- #name ⇒ String|Symbol readonly protected
Class Method Summary collapse
-
.by_name(name) ⇒ Array|Vedeu::Error::ModelNotFound
A collection of the names of interfaces refreshed, or an exception when the group was not found.
Instance Method Summary collapse
-
#absent?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable is nil or empty.
-
#become(klass, attributes) ⇒ Class
included
from Common
private
Converts one class into another.
-
#boolean(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating the value was a boolean.
-
#boolean?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Boolean.
- #by_name ⇒ void
-
#escape?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is an escape sequence object (e.g. Cells::Escape.).
-
#falsy?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value should be considered false.
- #group_from_interface ⇒ String|Symbol private
- #group_name ⇒ String private
-
#hash?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Hash.
-
#initialize(name) ⇒ Vedeu::Groups::Refresh
constructor
Return a new instance of Vedeu::Groups::Refresh.
- #interface ⇒ Vedeu::Interfaces::Interface private
-
#line_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a Views::Line.
-
#numeric?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Fixnum.
-
#present?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable has a useful value.
-
#snake_case(klass) ⇒ String
included
from Common
private
Converts a class name to a lowercase snake case string.
-
#stream_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a Views::Stream.
-
#string?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Fixnum.
-
#truthy?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value should be considered true.
-
#view_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a Views::View.
Constructor Details
#initialize(name) ⇒ Vedeu::Groups::Refresh
Return a new instance of Vedeu::Groups::Refresh.
34 35 36 |
# File 'lib/vedeu/groups/refresh.rb', line 34 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ String|Symbol (readonly, protected)
51 52 53 |
# File 'lib/vedeu/groups/refresh.rb', line 51 def name @name end |
Class Method Details
.by_name(name) ⇒ Array|Vedeu::Error::ModelNotFound
Returns A collection of the names of interfaces refreshed, or an exception when the group was not found.
26 27 28 |
# File 'lib/vedeu/groups/refresh.rb', line 26 def self.by_name(name) new(name).by_name end |
Instance Method Details
#absent?(variable) ⇒ Boolean Originally defined in module Common
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 a variable is nil or empty.
#become(klass, attributes) ⇒ Class Originally defined in module Common
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.
Converts one class into another.
#boolean(value) ⇒ Boolean Originally defined in module Common
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 the value was a boolean.
#boolean?(value) ⇒ Boolean Originally defined in module Common
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 value is a Boolean.
#by_name ⇒ void
This method returns an undefined value.
39 40 41 42 43 44 45 |
# File 'lib/vedeu/groups/refresh.rb', line 39 def by_name Vedeu.timer("Refresh Group: '#{group_name}'") do Vedeu.groups.by_name(group_name).by_zindex.each do |name| Vedeu.trigger(:_refresh_view_, name) end end end |
#escape?(value) ⇒ Boolean Originally defined in module Common
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 value is an escape sequence object (e.g. Vedeu::Cells::Escape.)
#falsy?(value) ⇒ Boolean Originally defined in module Common
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 value should be considered false.
#group_from_interface ⇒ String|Symbol (private)
66 67 68 |
# File 'lib/vedeu/groups/refresh.rb', line 66 def group_from_interface @_group_name ||= interface.group end |
#group_name ⇒ String (private)
57 58 59 60 61 62 63 |
# File 'lib/vedeu/groups/refresh.rb', line 57 def group_name return name if present?(name) return group_from_interface if present?(group_from_interface) fail Vedeu::Error::MissingRequired, 'Cannot refresh group with an empty group name.' end |
#hash?(value) ⇒ Boolean Originally defined in module Common
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 value is a Hash.
#interface ⇒ Vedeu::Interfaces::Interface (private)
71 72 73 |
# File 'lib/vedeu/groups/refresh.rb', line 71 def interface Vedeu.interfaces.by_name(name) end |
#line_model? ⇒ Boolean Originally defined in module Common
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 the model is a Views::Line.
#numeric?(value) ⇒ Boolean Originally defined in module Common
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 value is a Fixnum.
#present?(variable) ⇒ Boolean Originally defined in module Common
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 a variable has a useful value.
#snake_case(klass) ⇒ String Originally defined in module Common
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.
Converts a class name to a lowercase snake case string.
#stream_model? ⇒ Boolean Originally defined in module Common
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 the model is a Views::Stream.
#string?(value) ⇒ Boolean Originally defined in module Common
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 value is a Fixnum.
#truthy?(value) ⇒ Boolean Originally defined in module Common
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 value should be considered true.
#view_model? ⇒ Boolean Originally defined in module Common
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 the model is a Views::View.