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.
41 42 43 44 45 |
# File 'lib/rubyang/database/schema_tree.rb', line 41 def initialize @arg = 'string' @length = Length.new @pattern = Pattern.new end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
40 41 42 |
# File 'lib/rubyang/database/schema_tree.rb', line 40 def length @length end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
40 41 42 |
# File 'lib/rubyang/database/schema_tree.rb', line 40 def pattern @pattern end |
Instance Method Details
#update_length(arg) ⇒ Object
46 47 48 |
# File 'lib/rubyang/database/schema_tree.rb', line 46 def update_length arg @length.update arg end |
#update_pattern(arg) ⇒ Object
49 50 51 |
# File 'lib/rubyang/database/schema_tree.rb', line 49 def update_pattern arg @pattern.update arg end |
#valid?(value) ⇒ Boolean
52 53 54 55 56 57 |
# File 'lib/rubyang/database/schema_tree.rb', line 52 def valid? value result = true result &&= @length.valid? value result &&= @pattern.valid? value result end |