Class: Vedeu::Buffers::RefreshContent

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/vedeu/buffers/refresh_content.rb

Overview

Refreshes only the content of the given named interface.

Instance Attribute Summary collapse

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

#initialize(name = Vedeu.focus) ⇒ Vedeu::Buffers::RefreshContent

Return a new instance of Vedeu::Buffers::RefreshContent.

Parameters:

  • name (NilClass|Symbol|String) (defaults to: Vedeu.focus)

    The name of the model or target model to act upon. May default to ‘Vedeu.focus`.



24
25
26
# File 'lib/vedeu/buffers/refresh_content.rb', line 24

def initialize(name = Vedeu.focus)
  @name = name || Vedeu.focus
end

Instance Attribute Details

#nameNilClass|Symbol|String (readonly, protected)

Returns The name of the model, the target model or the name of the associated model.

Returns:

  • (NilClass|Symbol|String)

    The name of the model, the target model or the name of the associated model.



39
40
41
# File 'lib/vedeu/buffers/refresh_content.rb', line 39

def name
  @name
end

Class Method Details

.by_name(name = Vedeu.focus) ⇒ Array|Vedeu::Error::ModelNotFound

Parameters:

  • name (NilClass|Symbol|String) (defaults to: Vedeu.focus)

    The name of the model or target model to act upon. May default to ‘Vedeu.focus`.

Returns:



16
17
18
# File 'lib/vedeu/buffers/refresh_content.rb', line 16

def self.by_name(name = Vedeu.focus)
  new(name).by_name
end

Instance Method Details

#bufferVedeu::Buffers::Buffer (private)



44
45
46
# File 'lib/vedeu/buffers/refresh_content.rb', line 44

def buffer
  Vedeu.buffers.by_name(name)
end

#by_nameArray|Vedeu::Error::ModelNotFound

Returns:



29
30
31
32
33
# File 'lib/vedeu/buffers/refresh_content.rb', line 29

def by_name
  Vedeu.clear_content_by_name(name)

  buffer.render
end