Class: Vedeu::Interfaces::Interface
- Inherits:
-
Object
- Object
- Vedeu::Interfaces::Interface
- Includes:
- Presentation, 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>
-
#defaults ⇒ Hash<Symbol => void>
private
The default options/attributes for a new instance of this class.
-
#deputy(client = nil) ⇒ Vedeu::Interfaces::DSL
Returns a DSL instance responsible for defining the DSL methods of this model.
-
#hide ⇒ void
Hide the named interface.
-
#initialize(attributes = {}) ⇒ Vedeu::Interfaces::Interface
constructor
Return a new instance of Vedeu::Interfaces::Interface.
-
#show ⇒ void
Show the named interface.
Methods included from Toggleable
Methods included from Presentation
Methods included from Presentation::Styles
#render_style, #style, #style=
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=, #named_colour, #named_colour?, #parent_colour, #parent_colour?, #render_colour
Methods included from Repositories::Model
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::Interfaces::Interface
Return a new instance of Vedeu::Interfaces::Interface.
70 71 72 73 74 |
# File 'lib/vedeu/interfaces/interface.rb', line 70 def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#client ⇒ Fixnum|Float
18 19 20 |
# File 'lib/vedeu/interfaces/interface.rb', line 18 def client @client end |
#cursor_visible ⇒ Boolean Also known as: cursor_visible?
22 23 24 |
# File 'lib/vedeu/interfaces/interface.rb', line 22 def cursor_visible @cursor_visible end |
#delay ⇒ Fixnum|Float
27 28 29 |
# File 'lib/vedeu/interfaces/interface.rb', line 27 def delay @delay end |
#editable ⇒ Boolean Also known as: editable?
31 32 33 |
# File 'lib/vedeu/interfaces/interface.rb', line 31 def editable @editable end |
#group ⇒ Symbol|String
36 37 38 |
# File 'lib/vedeu/interfaces/interface.rb', line 36 def group @group end |
#name ⇒ String
40 41 42 |
# File 'lib/vedeu/interfaces/interface.rb', line 40 def name @name end |
#parent ⇒ Vedeu::Views::Composition
44 45 46 |
# File 'lib/vedeu/interfaces/interface.rb', line 44 def parent @parent end |
#wordwrap ⇒ Boolean
48 49 50 |
# File 'lib/vedeu/interfaces/interface.rb', line 48 def wordwrap @wordwrap end |
#zindex ⇒ Fixnum
52 53 54 |
# File 'lib/vedeu/interfaces/interface.rb', line 52 def zindex @zindex end |
Instance Method Details
#attributes ⇒ Hash<Symbol => void>
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/vedeu/interfaces/interface.rb', line 77 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)
The default options/attributes for a new instance of this class.
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/vedeu/interfaces/interface.rb', line 150 def defaults { client: nil, colour: Vedeu.config.colour, cursor_visible: true, delay: 0.0, editable: false, group: '', name: '', parent: nil, repository: Vedeu.interfaces, style: :normal, visible: true, wordwrap: true, zindex: 0, } end |
#deputy(client = nil) ⇒ Vedeu::Interfaces::DSL
Returns a DSL instance responsible for defining the DSL methods of this model.
104 105 106 |
# File 'lib/vedeu/interfaces/interface.rb', line 104 def deputy(client = nil) Vedeu::Interfaces::DSL.new(self, client) end |
#hide ⇒ void
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.
121 122 123 124 125 |
# File 'lib/vedeu/interfaces/interface.rb', line 121 def hide super Vedeu.trigger(:_clear_view_, name) end |
#show ⇒ void
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.
141 142 143 144 145 |
# File 'lib/vedeu/interfaces/interface.rb', line 141 def show super Vedeu.trigger(:_refresh_view_, name) end |