Class: Rubyang::Database::SchemaTree::StringType
- Defined in:
- lib/rubyang/database/schema_tree.rb
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize ⇒ StringType
constructor
A new instance of StringType.
- #update_length(arg) ⇒ Object
- #update_pattern(arg) ⇒ Object
- #valid?(value) ⇒ Boolean
Constructor Details
#initialize ⇒ StringType
Returns a new instance of StringType.
102 103 104 105 106 |
# File 'lib/rubyang/database/schema_tree.rb', line 102 def initialize @arg = 'string' @length = Length.new @pattern = Pattern.new end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
101 102 103 |
# File 'lib/rubyang/database/schema_tree.rb', line 101 def length @length end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
101 102 103 |
# File 'lib/rubyang/database/schema_tree.rb', line 101 def pattern @pattern end |
Instance Method Details
#update_length(arg) ⇒ Object
107 108 109 |
# File 'lib/rubyang/database/schema_tree.rb', line 107 def update_length arg @length.update arg end |
#update_pattern(arg) ⇒ Object
110 111 112 |
# File 'lib/rubyang/database/schema_tree.rb', line 110 def update_pattern arg @pattern.update arg end |
#valid?(value) ⇒ Boolean
113 114 115 116 117 118 |
# File 'lib/rubyang/database/schema_tree.rb', line 113 def valid? value result = true result &&= @length.valid? value result &&= @pattern.valid? value result end |