Class: Vedeu::View Deprecated Private

Inherits:
Object
  • Object
show all
Includes:
API
Defined in:
lib/vedeu/output/view.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.

Deprecated.

May disappear in 0.3.0. Prefer API#render instead.

Subclassing Vedeu::View will allow Vedeu to call your #render method. This method should contain attributes required to build a view or views. These attributes will be added to the back buffer of each interface mentioned, to be rendered upon next refresh.

See Also:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from API

#configure, #defined, #event, #focus, #height, #interface, #keypress, #keys, #log, #menu, #resize, #trigger, #unevent, #use, #view, #views, #width

Constructor Details

#initialize(object = nil) ⇒ View

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 new instance of View.

Parameters:

  • object (defaults to: nil)


25
26
27
# File 'lib/vedeu/output/view.rb', line 25

def initialize(object = nil)
  @object = object
end

Instance Attribute Details

#objectObject (readonly, 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.



45
46
47
# File 'lib/vedeu/output/view.rb', line 45

def object
  @object
end

Class Method Details

.render(object = nil) ⇒ Array

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.

Parameters:

  • object (defaults to: nil)

Returns:

  • (Array)


17
18
19
# File 'lib/vedeu/output/view.rb', line 17

def self.render(object = nil)
  new(object).enqueue
end

Instance Method Details

#attributesObject (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.

Calls the #render method of the subclass, hopefully receives attributes suitable to create one or more views.

Returns:



60
61
62
# File 'lib/vedeu/output/view.rb', line 60

def attributes
  render
end

#compositionComposition (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.

Create a new Composition object with the attributes.

Returns:



51
52
53
# File 'lib/vedeu/output/view.rb', line 51

def composition
  @_composition ||= Composition.new(attributes)
end

#enqueueArray

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:

  • (Array)


30
31
32
33
34
# File 'lib/vedeu/output/view.rb', line 30

def enqueue
  composition.interfaces.map do |interface|
    Buffers.add(interface.attributes)
  end
end

#renderException

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:

  • (Exception)

Raises:

  • (NotImplemented)

    Subclasses of this class must implement this method.



39
40
41
# File 'lib/vedeu/output/view.rb', line 39

def render
  fail NotImplemented, 'Implement #render on your subclass of Vedeu::View.'
end