Class: Vedeu::Views::Composition Private

Inherits:
Object
  • Object
show all
Includes:
Presentation, Presentation::Colour, Presentation::Position, Presentation::Styles, Repositories::Model, Value
Defined in:
lib/vedeu/views/composition.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.

A composition is a collection of interfaces.

Instance Attribute Summary

Attributes included from Repositories::Model

#repository

Instance Method Summary collapse

Methods included from Value

included

Methods included from Presentation::Styles

#render_style, #style, #style=, #style?

Methods included from Presentation::Parent

#name, #parent, #parent?

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?

Methods included from Presentation::Position

#position, #position=, #position?, #render_position, #x, #y

Methods included from Presentation::Colour

#background, #background=, #colour, #colour=, #colour?, #foreground, #foreground=, #interface, #named_colour, #named_colour?, #parent_colour, #parent_colour?, #render_colour

Methods included from Presentation

#to_s

Methods included from Repositories::Model

included, #store

Constructor Details

#initialize(attributes = {}) ⇒ Vedeu::Views::Composition

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 Vedeu::Views::Composition.

Parameters:

  • attributes (Hash<Symbol => void>) (defaults to: {})

Options Hash (attributes):



40
41
42
43
44
# File 'lib/vedeu/views/composition.rb', line 40

def initialize(attributes = {})
  defaults.merge!(attributes).each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Method Details

#attributesHash<Symbol => void>

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:

  • (Hash<Symbol => void>)


47
48
49
50
51
52
53
54
55
# File 'lib/vedeu/views/composition.rb', line 47

def attributes
  {
    client: client,
    colour: colour,
    parent: parent,
    style:  style,
    value:  value,
  }
end

#defaultsHash<Symbol => void> (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.

The default options/attributes for a new instance of this class.

Returns:

  • (Hash<Symbol => void>)


70
71
72
73
74
75
76
77
78
# File 'lib/vedeu/views/composition.rb', line 70

def defaults
  {
    client: nil,
    colour: nil,
    parent: nil,
    style:  nil,
    value:  [],
  }
end

#update_buffers(refresh = false) ⇒ Vedeu::Views::Composition

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:

  • refresh (Boolean) (defaults to: false)

    Should the buffer(s) of the view(s) in this composition be refreshed once stored? Default: false.

Returns:



61
62
63
64
65
# File 'lib/vedeu/views/composition.rb', line 61

def update_buffers(refresh = false)
  views.each { |view| view.update_buffer(refresh) } if views?

  self
end