Class: Vedeu::Buffers::Refresh
- Inherits:
-
Object
- Object
- Vedeu::Buffers::Refresh
show all
- Includes:
- Common
- Defined in:
- lib/vedeu/buffers/refresh.rb
Overview
Refreshes the given named interface.
Class Method Summary
collapse
Instance Method Summary
collapse
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
Return a new instance of Vedeu::Buffers::Refresh.
37
38
39
40
|
# File 'lib/vedeu/buffers/refresh.rb', line 37
def initialize(name, options = {})
@name = name
@options = options
end
|
Class Method Details
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
|
25
26
27
28
29
|
# File 'lib/vedeu/buffers/refresh.rb', line 25
def self.refresh_content_by_name(name = Vedeu.focus)
name ||= Vedeu.focus
new(name, content_only: true).by_name
end
|
Instance Method Details
54
55
56
|
# File 'lib/vedeu/buffers/refresh.rb', line 54
def buffer
Vedeu.buffers.by_name(name)
end
|
43
44
45
46
47
48
49
|
# File 'lib/vedeu/buffers/refresh.rb', line 43
def by_name
Vedeu.trigger(:_clear_view_content_, name)
buffer.render
Vedeu.trigger(:_refresh_border_, name) unless content_only?
end
|
#content_only? ⇒ Boolean
59
60
61
|
# File 'lib/vedeu/buffers/refresh.rb', line 59
def content_only?
truthy?(options[:content_only])
end
|
#defaults ⇒ Hash<Symbol => void>
The default options/attributes for a new instance of this class.
74
75
76
77
78
|
# File 'lib/vedeu/buffers/refresh.rb', line 74
def defaults
{
content_only: false,
}
end
|
#name ⇒ String|Symbol
64
65
66
|
# File 'lib/vedeu/buffers/refresh.rb', line 64
def name
present?(@name) ? @name : Vedeu.focus
end
|
#options ⇒ Hash<Symbol => Boolean>
69
70
71
|
# File 'lib/vedeu/buffers/refresh.rb', line 69
def options
defaults.merge!(@options)
end
|