Class: Vedeu::Views::Line::DSL
- Inherits:
-
Object
- Object
- Vedeu::Views::Line::DSL
- Includes:
- DSL, DSL::Elements
- Defined in:
- lib/vedeu/views/line.rb
Overview
Provides DSL methods for Vedeu::Views::Line objects.
Instance Attribute Summary collapse
-
#client ⇒ Object
included
from DSL
readonly
protected
The object instance where the DSL is being used.
-
#model ⇒ void
included
from DSL
readonly
protected
The new model object which the DSL is constructing.
Instance Method Summary collapse
-
#absent?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable is nil or empty.
-
#attributes ⇒ Hash<Symbol => void>
included
from DSL
private
Returns the default attributes for the new model.
-
#background(value = '') ⇒ String
(also: #bg, #bgcolor, #background=, #bg=, #bgcolor=)
included
from DSL::Presentation
Define the background colour for an interface, line, or a stream.
-
#become(klass, attributes) ⇒ Class
included
from Common
private
Converts one class into another.
-
#boolean(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating the value was a boolean.
-
#boolean?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Boolean.
- #centre(value = '', opts = {}) ⇒ void (also: #center) included from DSL::Elements
-
#colour(attrs = {}) ⇒ Vedeu::Colours::Colour
(also: #colour=)
included
from DSL::Presentation
Define either or both foreground and background colours for an interface, line or a stream.
- #colour_attributes ⇒ Hash<Symbol => String> included from DSL::Presentation private
-
#escape?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is an escape sequence object (e.g. Cells::Escape.).
-
#falsy?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value should be considered false.
- #foreground(value = '') ⇒ Object (also: #fg, #fgcolor, #foreground=, #fg=, #fgcolor=) included from DSL::Presentation
-
#hash?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Hash.
-
#initialize(model, client = nil) ⇒ void
included
from DSL
Returns a new instance of the DSL class including DSL.
- #left(value = '', opts = {}) ⇒ void included from DSL::Elements
-
#line(value = '', opts = {}, &block) ⇒ void
included
from DSL::Elements
Specify a single line in a view.
-
#line_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a Vedeu::Views::Line.
-
#lines(opts = {}, &block) ⇒ void
(also: #streams)
included
from DSL::Elements
Specify multiple lines in a view.
-
#method_missing(method, *args, &block) ⇒ void
included
from DSL
private
Attempts to find the missing method on the client object.
-
#name ⇒ NilClass|String|Symbol
included
from DSL
Returns the model name if available.
-
#numeric?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Fixnum.
-
#present?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable has a useful value.
- #requires_block!(&block) ⇒ NilClass included from DSL::Elements private
- #requires_model! ⇒ NilClass included from DSL::Elements private
- #right(value = '', opts = {}) ⇒ void included from DSL::Elements
-
#snake_case(klass) ⇒ String
included
from Common
private
Converts a class name to a lowercase snake case string.
- #stream(value = '', opts = {}, &block) ⇒ void included from DSL::Elements
-
#stream_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a Stream.
-
#string?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Fixnum.
-
#style(value) ⇒ Vedeu::Presentation::Style
(also: #style=, #styles, #styles=)
included
from DSL::Presentation
Define a style or styles for an interface, line or a stream.
-
#text(value = '', opts = {}) ⇒ void
included
from DSL::Elements
Specify the content for a view.
-
#truthy?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value should be considered true.
-
#view_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a View.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Vedeu::DSL
Instance Attribute Details
#client ⇒ Object (readonly, protected) Originally defined in module DSL
#model ⇒ void (readonly, protected) Originally defined in module DSL
Instance Method Details
#absent?(variable) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether a variable is nil or empty.
#attributes ⇒ Hash<Symbol => void> (private) Originally defined in module DSL
Specific DSL classes may be overriding this method.
Returns the default attributes for the new model.
#background(value = '') ⇒ String Also known as: bg, bgcolor, background=, bg=, bgcolor= Originally defined in module DSL::Presentation
The last defined background colour for a particular interface, line or stream overrides previously defined entries in the same block.
Define the background colour for an interface, line, or a stream. When called with a block, will create a new stream with the background colour specified. When the block terminates, the background will return to that of the parent.
#become(klass, attributes) ⇒ Class Originally defined in module Common
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.
Converts one class into another.
#boolean(value) ⇒ Boolean Originally defined in module Common
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 boolean indicating the value was a boolean.
#boolean?(value) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether the value is a Boolean.
#centre(value = '', opts = {}) ⇒ void Also known as: center Originally defined in module DSL::Elements
This method returns an undefined value.
#colour(attrs = {}) ⇒ Vedeu::Colours::Colour Also known as: colour= Originally defined in module DSL::Presentation
Rejects invalid keys and empty/nil attributes. Also, the last defined colour for a particular interface, line or stream overrides previously defined entries in the same block.
Define either or both foreground and background colours for an interface, line or a stream. At least one attribute is required.
#colour_attributes ⇒ Hash<Symbol => String> (private) Originally defined in module DSL::Presentation
#escape?(value) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether the value is an escape sequence object (e.g. Vedeu::Cells::Escape.)
#falsy?(value) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether the value should be considered false.
#foreground(value = '') ⇒ Object Also known as: fg, fgcolor, foreground=, fg=, fgcolor= Originally defined in module DSL::Presentation
#hash?(value) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether the value is a Hash.
#initialize(model, client = nil) ⇒ void Originally defined in module DSL
Returns a new instance of the DSL class including Vedeu::DSL.
#left(value = '', opts = {}) ⇒ void Originally defined in module DSL::Elements
This method returns an undefined value.
#line(value = '', opts = {}, &block) ⇒ void Originally defined in module DSL::Elements
This documentation needs editing. (GL: 2015-12-17)
This method returns an undefined value.
Specify a single line in a view.
Vedeu.renders do
view :my_interface do
lines do
line 'some text...'
# ... some code
line 'some more text...'
# ... some code
end
end
end
#line_model? ⇒ Boolean Originally defined in module Common
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 boolean indicating the model is a Views::Line.
#lines(opts = {}, &block) ⇒ void Also known as: streams Originally defined in module DSL::Elements
This documentation needs editing. (GL: 2015-12-17)
This method returns an undefined value.
Specify multiple lines in a view.
#name ⇒ NilClass|String|Symbol Originally defined in module DSL
Returns the model name if available.
#numeric?(value) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether the value is a Fixnum.
#present?(variable) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether a variable has a useful value.
#requires_block!(&block) ⇒ NilClass (private) Originally defined in module DSL::Elements
#requires_model! ⇒ NilClass (private) Originally defined in module DSL::Elements
#right(value = '', opts = {}) ⇒ void Originally defined in module DSL::Elements
This method returns an undefined value.
#snake_case(klass) ⇒ String Originally defined in module Common
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.
Converts a class name to a lowercase snake case string.
#stream(value = '', opts = {}, &block) ⇒ void Originally defined in module DSL::Elements
This method returns an undefined value.
#stream_model? ⇒ Boolean Originally defined in module Common
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 boolean indicating the model is a Views::Stream.
#string?(value) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether the value is a Fixnum.
#style(value) ⇒ Vedeu::Presentation::Style Also known as: style=, styles, styles= Originally defined in module DSL::Presentation
Define a style or styles for an interface, line or a stream.
#text(value = '', opts = {}) ⇒ void Originally defined in module DSL::Elements
This documentation needs editing. (GL: 2015-12-17)
If using the convenience methods; left, centre, center or right, then a specified align option will be ignored.
This method returns an undefined value.
Specify the content for a view. Provides the means to align a string (or object responding to ‘to_s`), and add it as a Line or to the Stream.
#truthy?(value) ⇒ Boolean Originally defined in module Common
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 boolean indicating whether the value should be considered true.
#view_model? ⇒ Boolean Originally defined in module Common
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 boolean indicating the model is a Views::View.