Class: Vedeu::Groups::Refresh Private
- Inherits:
-
Object
- Object
- Vedeu::Groups::Refresh
- Includes:
- Common
- Defined in:
- lib/vedeu/groups/refresh.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
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 ⇒ NilClass|Symbol|String
readonly
protected
private
The name of the model, the target model or the name of the associated model.
Class Method Summary collapse
-
.by_name(name) ⇒ Array|Vedeu::Error::ModelNotFound
private
A collection of the names of interfaces refreshed, or an exception when the group was not found.
Instance Method Summary collapse
- #by_name ⇒ void private
- #group_name ⇒ String private private
-
#initialize(name) ⇒ Vedeu::Groups::Refresh
constructor
private
Return a new instance of Vedeu::Groups::Refresh.
-
#interface ⇒ Vedeu::Interfaces::Interface
private
private
Returns the named interface/view from the interfaces repository.
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
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::Groups::Refresh.
35 36 37 |
# File 'lib/vedeu/groups/refresh.rb', line 35 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ NilClass|Symbol|String (readonly, protected)
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 name of the model, the target model or the name of the associated model.
52 53 54 |
# File 'lib/vedeu/groups/refresh.rb', line 52 def name @name end |
Class Method Details
.by_name(name) ⇒ Array|Vedeu::Error::ModelNotFound
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 collection of the names of interfaces refreshed, or an exception when the group was not found.
27 28 29 |
# File 'lib/vedeu/groups/refresh.rb', line 27 def self.by_name(name) new(name).by_name end |
Instance Method Details
#by_name ⇒ void
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.
This method returns an undefined value.
40 41 42 43 44 45 46 |
# File 'lib/vedeu/groups/refresh.rb', line 40 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_name ⇒ String (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.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/vedeu/groups/refresh.rb', line 58 def group_name if present?(name) name elsif present?(interface.group) interface.group else raise Vedeu::Error::MissingRequired, 'Cannot refresh group with an empty group name.' end 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.
73 74 75 |
# File 'lib/vedeu/groups/refresh.rb', line 73 def interface Vedeu.interfaces.by_name(name) end |