Class: Vedeu::Interfaces::Interface

Inherits:
Object
  • Object
show all
Includes:
Presentation, Presentation::Colour, Presentation::Position, Presentation::Styles, Repositories::Model, Toggleable
Defined in:
lib/vedeu/interfaces/interface.rb,
lib/vedeu/interfaces/repository.rb

Overview

Interfaces

Instance Attribute Summary collapse

Attributes included from Toggleable

#visible

Attributes included from Repositories::Model

#repository

Instance Method Summary collapse

Methods included from Toggleable

included, #toggle

Methods included from Presentation::Styles

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

Methods included from Presentation::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::Interfaces::Interface

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.

Return a new instance of Vedeu::Interfaces::Interface.

Parameters:

  • attributes (Hash) (defaults to: {})

Options Hash (attributes):



75
76
77
78
79
# File 'lib/vedeu/interfaces/interface.rb', line 75

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

Instance Attribute Details

#clientFixnum|Float

Returns:

  • (Fixnum|Float)


23
24
25
# File 'lib/vedeu/interfaces/interface.rb', line 23

def client
  @client
end

#cursor_visibleBoolean Also known as: cursor_visible?

Returns:



27
28
29
# File 'lib/vedeu/interfaces/interface.rb', line 27

def cursor_visible
  @cursor_visible
end

#delayFixnum|Float

Returns:

  • (Fixnum|Float)


32
33
34
# File 'lib/vedeu/interfaces/interface.rb', line 32

def delay
  @delay
end

#editableBoolean Also known as: editable?

Returns:



36
37
38
# File 'lib/vedeu/interfaces/interface.rb', line 36

def editable
  @editable
end

#groupSymbol|String

Returns:

  • (Symbol|String)


41
42
43
# File 'lib/vedeu/interfaces/interface.rb', line 41

def group
  @group
end

#nameString

Returns:

  • (String)


45
46
47
# File 'lib/vedeu/interfaces/interface.rb', line 45

def name
  @name
end

#parentVedeu::Views::Composition



49
50
51
# File 'lib/vedeu/interfaces/interface.rb', line 49

def parent
  @parent
end

#wordwrapBoolean

Returns:



53
54
55
# File 'lib/vedeu/interfaces/interface.rb', line 53

def wordwrap
  @wordwrap
end

#zindexFixnum

Returns:

  • (Fixnum)


57
58
59
# File 'lib/vedeu/interfaces/interface.rb', line 57

def zindex
  @zindex
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>)


82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/vedeu/interfaces/interface.rb', line 82

def attributes
  {
    client:         client,
    colour:         colour,
    cursor_visible: cursor_visible,
    delay:          delay,
    editable:       editable,
    group:          group,
    name:           name,
    parent:         parent,
    repository:     repository,
    style:          style,
    visible:        visible,
    wordwrap:       wordwrap,
    zindex:         zindex,
  }
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>)


155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/vedeu/interfaces/interface.rb', line 155

def defaults
  {
    client:         nil,
    colour:         Vedeu.config.colour,
    cursor_visible: true,
    delay:          0.0,
    editable:       false,
    group:          '',
    name:           nil,
    parent:         nil,
    repository:     Vedeu.interfaces,
    style:          :normal,
    visible:        true,
    wordwrap:       true,
    zindex:         0,
  }
end

#deputy(client = nil) ⇒ Vedeu::Interfaces::DSL

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 DSL instance responsible for defining the DSL methods of this model.

Parameters:

  • client (Object|NilClass) (defaults to: nil)

    The client binding represents the client application object that is currently invoking a DSL method. It is required so that we can send messages to the client application object should we need to.

Returns:



109
110
111
# File 'lib/vedeu/interfaces/interface.rb', line 109

def deputy(client = nil)
  Vedeu::Interfaces::DSL.new(self, client)
end

#hidevoid

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.

This method returns an undefined value.

Hide the named interface.

Will hide the named interface. If the interface is currently visible, it will be cleared- rendered blank. To show the interface, the ‘:show_interface’ event should be triggered. Triggering the ‘:hide_group’ event to which this named interface belongs will also hide the interface.

Examples:

Vedeu.trigger(:_hide_interface_, name)
Vedeu.hide_interface(name)


126
127
128
129
130
# File 'lib/vedeu/interfaces/interface.rb', line 126

def hide
  super

  Vedeu.trigger(:_clear_view_, name)
end

#showvoid

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.

This method returns an undefined value.

Show the named interface.

Will show the named interface. If the interface is currently visible, it will be refreshed- showing any new content available. To hide the interface, the ‘:hide_interface’ event should be triggered. Triggering the ‘:show_group’ event to which this named interface belongs will also show the interface.

Examples:

Vedeu.trigger(:_show_interface_, name)
Vedeu.show_interface(name)


146
147
148
149
150
# File 'lib/vedeu/interfaces/interface.rb', line 146

def show
  super

  Vedeu.trigger(:_refresh_view_, name)
end