Module: Vedeu::Geometry::Validator Private
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.
Validate values given to DSL.
Instance Method Summary collapse
-
#absent?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable is nil or empty.
-
#demodulize(klass) ⇒ String
included
from Common
private
Removes the module part from the expression in the string.
-
#present?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable has a useful value.
-
#snake_case(name) ⇒ String
included
from Common
private
Converts a class name to a lowercase snake case string.
- #validate_height!(value) ⇒ TrueClass private
- #validate_horizontal_alignment!(value) ⇒ TrueClass private
- #validate_vertical_alignment!(value) ⇒ TrueClass private
- #validate_width!(value) ⇒ TrueClass private
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.
#demodulize(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.
Removes the module part from the expression in the string.
#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.
#snake_case(name) ⇒ 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.
#validate_height!(value) ⇒ TrueClass
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.
16 17 18 19 20 21 |
# File 'lib/vedeu/geometry/validator.rb', line 16 def validate_height!(value) fail Vedeu::Error::InvalidSyntax, 'No height given.'.freeze if absent?(value) true end |
#validate_horizontal_alignment!(value) ⇒ TrueClass
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.
27 28 29 30 31 32 33 |
# File 'lib/vedeu/geometry/validator.rb', line 27 def validate_horizontal_alignment!(value) fail Vedeu::Error::InvalidSyntax, 'No horizontal alignment given. Valid values are :center, ' \ ':centre, :left, :none, :right.'.freeze unless present?(value) true end |
#validate_vertical_alignment!(value) ⇒ TrueClass
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.
38 39 40 41 42 43 44 |
# File 'lib/vedeu/geometry/validator.rb', line 38 def validate_vertical_alignment!(value) fail Vedeu::Error::InvalidSyntax, 'No vertical alignment given. Valid values are :bottom, ' \ ':middle, :none, :top.'.freeze unless present?(value) true end |
#validate_width!(value) ⇒ TrueClass
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.
49 50 51 52 53 54 |
# File 'lib/vedeu/geometry/validator.rb', line 49 def validate_width!(value) fail Vedeu::Error::InvalidSyntax, 'No width given.'.freeze if absent?(value) true end |