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.
- #by_name ⇒ void
-
#demodulize(klass) ⇒ String
included
from Common
private
Removes the module part from the expression in the string.
- #group_from_interface ⇒ String|Symbol private
- #group_name ⇒ String private
-
#initialize(name) ⇒ Vedeu::Groups::Refresh
constructor
Return a new instance of Vedeu::Groups::Refresh.
-
#present?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable has a useful value.
-
#snake_case(name) ⇒ String
included
from Common
private
Converts a class name to a lowercase snake case string.
Constructor Details
#initialize(name) ⇒ Vedeu::Groups::Refresh
Return a new instance of Vedeu::Groups::Refresh.
32 33 34 |
# File 'lib/vedeu/groups/refresh.rb', line 32 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ String|Symbol (readonly, protected)
49 50 51 |
# File 'lib/vedeu/groups/refresh.rb', line 49 def name @name end |
Class Method Details
.by_name(name) ⇒ Array|Vedeu::Error::ModelNotFound
24 25 26 |
# File 'lib/vedeu/groups/refresh.rb', line 24 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.
#by_name ⇒ void
37 38 39 40 41 42 43 |
# File 'lib/vedeu/groups/refresh.rb', line 37 def by_name Vedeu.timer("Refresh Group: '#{group_name}'".freeze) do Vedeu.groups.by_name(group_name).by_zindex.each do |name| Vedeu.trigger(:_refresh_view_, name) end end end |
#demodulize(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.
Removes the module part from the expression in the string.
#group_from_interface ⇒ String|Symbol (private)
65 66 67 |
# File 'lib/vedeu/groups/refresh.rb', line 65 def group_from_interface @_group_name ||= Vedeu.interfaces.by_name(name).group end |
#group_name ⇒ String (private)
56 57 58 59 60 61 62 |
# File 'lib/vedeu/groups/refresh.rb', line 56 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.'.freeze end |
#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(name) ⇒ 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.