Class: Vedeu::RefreshGroup
- Inherits:
-
Object
- Object
- Vedeu::RefreshGroup
- Includes:
- Common
- Defined in:
- lib/vedeu/refresh/refresh_group.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 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
- #by_name ⇒ void
- #group_name ⇒ String private
-
#initialize(name) ⇒ Vedeu::RefreshGroup
constructor
Return a new instance of Vedeu::RefreshGroup.
Methods included from Common
#demodulize, #present?, #snake_case
Constructor Details
#initialize(name) ⇒ Vedeu::RefreshGroup
Return a new instance of Vedeu::RefreshGroup.
27 28 29 |
# File 'lib/vedeu/refresh/refresh_group.rb', line 27 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ String (readonly, protected)
44 45 46 |
# File 'lib/vedeu/refresh/refresh_group.rb', line 44 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.
19 20 21 |
# File 'lib/vedeu/refresh/refresh_group.rb', line 19 def self.by_name(name) new(name).by_name end |
Instance Method Details
#by_name ⇒ void
This method returns an undefined value.
32 33 34 35 36 37 38 |
# File 'lib/vedeu/refresh/refresh_group.rb', line 32 def by_name Vedeu.timer("Refresh Group: '#{group_name}'") do Vedeu.groups.by_name(group_name).by_zindex.each do |name| Vedeu::Buffers::Refresh.by_name(name) end end end |
#group_name ⇒ String (private)
50 51 52 53 54 55 |
# File 'lib/vedeu/refresh/refresh_group.rb', line 50 def group_name return name if present?(name) fail Vedeu::Error::MissingRequired, 'Cannot refresh group with an empty group name.' end |