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
- #by_name ⇒ void
- #group_from_interface ⇒ String|Symbol private
- #group_name ⇒ String private
-
#initialize(name) ⇒ Vedeu::Groups::Refresh
constructor
Return a new instance of Vedeu::Groups::Refresh.
- #interface ⇒ Vedeu::Interfaces::Interface private
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?
Constructor Details
#initialize(name) ⇒ Vedeu::Groups::Refresh
Return a new instance of Vedeu::Groups::Refresh.
33 34 35 |
# File 'lib/vedeu/groups/refresh.rb', line 33 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ String|Symbol (readonly, protected)
50 51 52 |
# File 'lib/vedeu/groups/refresh.rb', line 50 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.
25 26 27 |
# File 'lib/vedeu/groups/refresh.rb', line 25 def self.by_name(name) new(name).by_name end |
Instance Method Details
#by_name ⇒ void
This method returns an undefined value.
38 39 40 41 42 43 44 |
# File 'lib/vedeu/groups/refresh.rb', line 38 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 |
#group_from_interface ⇒ String|Symbol (private)
65 66 67 |
# File 'lib/vedeu/groups/refresh.rb', line 65 def group_from_interface @_group_name ||= interface.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) raise Vedeu::Error::MissingRequired, 'Cannot refresh group with an empty group name.' end |
#interface ⇒ Vedeu::Interfaces::Interface (private)
70 71 72 |
# File 'lib/vedeu/groups/refresh.rb', line 70 def interface Vedeu.interfaces.by_name(name) end |