Module: Vedeu::Views::DefaultAttributes Private

Includes:
Repositories::Defaults
Included in:
Line, Stream
Defined in:
lib/vedeu/views/default_attributes.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Provides the default attributes for variaus Vedeu::Views models.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alignVedeu::Coercers::Alignment (readonly)

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.



17
18
19
# File 'lib/vedeu/views/default_attributes.rb', line 17

def align
  @align
end

#padString (readonly)

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:

  • (String)


21
22
23
# File 'lib/vedeu/views/default_attributes.rb', line 21

def pad
  @pad
end

#truncateBoolean (readonly) Also known as: truncate?

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:



25
26
27
# File 'lib/vedeu/views/default_attributes.rb', line 25

def truncate
  @truncate
end

#widthFixnum|NilClass (readonly)

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:

  • (Fixnum|NilClass)


30
31
32
# File 'lib/vedeu/views/default_attributes.rb', line 30

def width
  @width
end

#wordwrapBoolean (readonly) Also known as: wordwrap?

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:



34
35
36
# File 'lib/vedeu/views/default_attributes.rb', line 34

def wordwrap
  @wordwrap
end

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.

Parameters:

  • variable (String|Symbol|Array|Fixnum)

    The variable to check.

Returns:

#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>)


38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/vedeu/views/default_attributes.rb', line 38

def attributes
  {
    align:    align,
    client:   client,
    colour:   colour,
    name:     name,
    pad:      pad,
    parent:   parent,
    style:    style,
    truncate: truncate,
    width:    width,
    wordwrap: wordwrap,
  }
end

#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.

Parameters:

  • klass (Class)

    The class to become an instance of.

  • attributes (Hash)

    The attributes of klass.

Returns:

  • (Class)

    Returns a new instance of klass.

#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.

Parameters:

  • value (void)

Returns:

#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.

Parameters:

Returns:

#defaultsHash<Symbol => Array<void>|NilClass> (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 values for a new instance of this class.

Returns:

  • (Hash<Symbol => Array<void>|NilClass>)


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/vedeu/views/default_attributes.rb', line 58

def defaults
  {
    align:    nil,
    client:   nil,
    colour:   nil,
    name:     nil,
    pad:      ' ',
    parent:   nil,
    style:    nil,
    truncate: false,
    value:    '',
    width:    nil,
    wordwrap: false,
  }
end

#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.)

Returns:

#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.

Parameters:

  • value (void)

Returns:

#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.

Parameters:

  • value (Hash|void)

Returns:

#initialize(attributes = {}) ⇒ void Originally defined in module Repositories::Defaults

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.

Note:

If a particular key is missing from the attributes parameter, then it is added with the respective value from #defaults.

Returns a new instance of the class including this module.

Parameters:

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

#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.

Returns:

#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.

Parameters:

  • value (Fixnum|void)

Returns:

#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.

Parameters:

  • variable (String|Symbol|Array|Fixnum)

    The variable to check.

Returns:

#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.

Examples:

snake_case(MyClassName) # => "my_class_name"
snake_case(NameSpaced::ClassName)
# => "name_spaced/class_name"

snake_case('MyClassName') # => "my_class_name"
snake_case(NameSpaced::ClassName)
# => "name_spaced/class_name"

Parameters:

  • klass (Module|Class|String)

Returns:

  • (String)

#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.

Returns:

#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.

Parameters:

  • value (String|void)

Returns:

#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.

Parameters:

  • value (void)

Returns:

#validate(attributes) ⇒ Hash (private) Originally defined in module Repositories::Defaults

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:

  • attributes (Hash)

Returns:

  • (Hash)

Raises:

  • (Vedeu::Error::InvalidSyntax)

    When the value given for an argument or parameter cannot be used because it is not valid for the use case, unsupported or the method expects a different type.

#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.

Returns: