Class: Vedeu::RefreshGroup

Inherits:
Object
  • Object
show all
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.

Examples:

Vedeu.trigger(:_refresh_group_, group_name)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

#demodulize, #present?, #snake_case

Constructor Details

#initialize(name) ⇒ Vedeu::RefreshGroup

Return a new instance of Vedeu::RefreshGroup.

Parameters:

  • name (String)


27
28
29
# File 'lib/vedeu/refresh/refresh_group.rb', line 27

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameString (readonly, protected)

Returns:

  • (String)


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.

Parameters:

  • name (String)

    The name of the group to be refreshed.

Returns:

  • (Array|Vedeu::Error::ModelNotFound)

    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_namevoid

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_nameString (private)

Returns:

  • (String)

Raises:



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