Class: Vedeu::Interfaces::Interface
- Inherits:
-
Object
- Object
- Vedeu::Interfaces::Interface
- 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
- #client ⇒ Fixnum|Float
- #cursor_visible ⇒ Boolean (also: #cursor_visible?)
- #delay ⇒ Fixnum|Float
- #editable ⇒ Boolean (also: #editable?)
- #group ⇒ Symbol|String
- #name ⇒ String
- #parent ⇒ Vedeu::Views::Composition
- #wordwrap ⇒ Boolean
- #zindex ⇒ Fixnum
Attributes included from Toggleable
Attributes included from Repositories::Model
Instance Method Summary collapse
- #attributes ⇒ Hash<Symbol => void> private
-
#defaults ⇒ Hash<Symbol => void>
private
private
The default options/attributes for a new instance of this class.
-
#deputy(client = nil) ⇒ Vedeu::Interfaces::DSL
private
Returns a DSL instance responsible for defining the DSL methods of this model.
-
#hide ⇒ void
private
Hide the named interface.
-
#initialize(attributes = {}) ⇒ Vedeu::Interfaces::Interface
constructor
private
Return a new instance of Vedeu::Interfaces::Interface.
-
#show ⇒ void
private
Show the named interface.
Methods included from Toggleable
Methods included from Presentation::Styles
#render_style, #style, #style=, #style?
Methods included from Presentation::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
Methods included from Repositories::Model
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.
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
#client ⇒ Fixnum|Float
23 24 25 |
# File 'lib/vedeu/interfaces/interface.rb', line 23 def client @client end |
#cursor_visible ⇒ Boolean Also known as: cursor_visible?
27 28 29 |
# File 'lib/vedeu/interfaces/interface.rb', line 27 def cursor_visible @cursor_visible end |
#delay ⇒ Fixnum|Float
32 33 34 |
# File 'lib/vedeu/interfaces/interface.rb', line 32 def delay @delay end |
#editable ⇒ Boolean Also known as: editable?
36 37 38 |
# File 'lib/vedeu/interfaces/interface.rb', line 36 def editable @editable end |
#group ⇒ Symbol|String
41 42 43 |
# File 'lib/vedeu/interfaces/interface.rb', line 41 def group @group end |
#name ⇒ String
45 46 47 |
# File 'lib/vedeu/interfaces/interface.rb', line 45 def name @name end |
#parent ⇒ Vedeu::Views::Composition
49 50 51 |
# File 'lib/vedeu/interfaces/interface.rb', line 49 def parent @parent end |
#wordwrap ⇒ Boolean
53 54 55 |
# File 'lib/vedeu/interfaces/interface.rb', line 53 def wordwrap @wordwrap end |
#zindex ⇒ Fixnum
57 58 59 |
# File 'lib/vedeu/interfaces/interface.rb', line 57 def zindex @zindex end |
Instance Method Details
#attributes ⇒ Hash<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.
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 |
#defaults ⇒ Hash<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.
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.
109 110 111 |
# File 'lib/vedeu/interfaces/interface.rb', line 109 def deputy(client = nil) Vedeu::Interfaces::DSL.new(self, client) end |
#hide ⇒ 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.
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.
126 127 128 129 130 |
# File 'lib/vedeu/interfaces/interface.rb', line 126 def hide super Vedeu.trigger(:_clear_view_, name) end |
#show ⇒ 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.
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.
146 147 148 149 150 |
# File 'lib/vedeu/interfaces/interface.rb', line 146 def show super Vedeu.trigger(:_refresh_view_, name) end |