Class: Vedeu::Buffers::Refresh
- Inherits:
-
Object
- Object
- Vedeu::Buffers::Refresh
- Includes:
- Common
- Defined in:
- lib/vedeu/buffers/refresh.rb
Overview
Refreshes the given named interface.
Instance Attribute Summary collapse
- #name ⇒ String|Symbol readonly protected
Class Method Summary collapse
- .by_name(name = Vedeu.focus) ⇒ Array|Vedeu::Error::ModelNotFound
- .refresh_content_by_name(name = Vedeu.focus) ⇒ Array|Vedeu::Error::ModelNotFound
Instance Method Summary collapse
-
#absent?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable is nil or empty.
- #by_name ⇒ Array|Vedeu::Error::ModelNotFound
- #content_only? ⇒ Boolean protected
- #defaults ⇒ Hash<Symbol => Boolean> protected
-
#demodulize(klass) ⇒ String
included
from Common
private
Removes the module part from the expression in the string.
-
#initialize(name, options = {}) ⇒ Vedeu::Buffers::Refresh
constructor
Return a new instance of Vedeu::Buffers::Refresh.
- #options ⇒ Hash<Symbol => Boolean> protected
-
#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, options = {}) ⇒ Vedeu::Buffers::Refresh
Return a new instance of Vedeu::Buffers::Refresh.
40 41 42 43 |
# File 'lib/vedeu/buffers/refresh.rb', line 40 def initialize(name, = {}) @name = present?(name) ? name : Vedeu.focus @options = end |
Instance Attribute Details
#name ⇒ String|Symbol (readonly, protected)
58 59 60 |
# File 'lib/vedeu/buffers/refresh.rb', line 58 def name @name end |
Class Method Details
.by_name(name = Vedeu.focus) ⇒ Array|Vedeu::Error::ModelNotFound
16 17 18 19 20 |
# File 'lib/vedeu/buffers/refresh.rb', line 16 def self.by_name(name = Vedeu.focus) name ||= Vedeu.focus new(name).by_name end |
.refresh_content_by_name(name = Vedeu.focus) ⇒ Array|Vedeu::Error::ModelNotFound
27 28 29 30 31 |
# File 'lib/vedeu/buffers/refresh.rb', line 27 def self.refresh_content_by_name(name = Vedeu.focus) name ||= Vedeu.focus new(name, content_only: true).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 ⇒ Array|Vedeu::Error::ModelNotFound
46 47 48 49 50 51 52 |
# File 'lib/vedeu/buffers/refresh.rb', line 46 def by_name Vedeu.trigger(:_clear_view_content_, name) Vedeu.buffers.by_name(name).render Vedeu.trigger(:_refresh_border_, name) unless content_only? end |
#content_only? ⇒ Boolean (protected)
61 62 63 |
# File 'lib/vedeu/buffers/refresh.rb', line 61 def content_only? [:content_only] == true end |
#defaults ⇒ Hash<Symbol => Boolean> (protected)
71 72 73 74 75 |
# File 'lib/vedeu/buffers/refresh.rb', line 71 def defaults { content_only: false } 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.
#options ⇒ Hash<Symbol => Boolean> (protected)
66 67 68 |
# File 'lib/vedeu/buffers/refresh.rb', line 66 def defaults.merge!(@options) 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.