Class: Vedeu::View

Inherits:
Object
  • Object
show all
Includes:
API
Defined in:
lib/vedeu/support/view.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from API

#event, #events, #height, #interface, #keypress, #log, #resize, #shutdown, #trigger, #unevent, #use, #view, #views, #width

Constructor Details

#initialize(object = nil) ⇒ View

Parameters:

  • object (defaults to: nil)


14
15
16
# File 'lib/vedeu/support/view.rb', line 14

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

Instance Attribute Details

#objectObject (readonly, private)

Returns the value of attribute object.



31
32
33
# File 'lib/vedeu/support/view.rb', line 31

def object
  @object
end

Class Method Details

.render(object = nil) ⇒ Array

Parameters:

  • object (defaults to: nil)

Returns:

  • (Array)


8
9
10
# File 'lib/vedeu/support/view.rb', line 8

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.

Returns [].

Returns:



47
48
49
# File 'lib/vedeu/support/view.rb', line 47

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.

Returns:



41
42
43
# File 'lib/vedeu/support/view.rb', line 41

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

#enqueueArray

Returns:

  • (Array)


19
20
21
# File 'lib/vedeu/support/view.rb', line 19

def enqueue
  interfaces.map { |interface| Buffers.enqueue(interface.name, interface) }
end

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

Returns:

  • (Array)


35
36
37
# File 'lib/vedeu/support/view.rb', line 35

def interfaces
  composition.interfaces
end

#renderException Also known as: output

Returns:

  • (Exception)


24
25
26
# File 'lib/vedeu/support/view.rb', line 24

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