Class: Sepa::StringWithConstraint
- Inherits:
-
Object
- Object
- Sepa::StringWithConstraint
- Defined in:
- lib/sepa/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(s) ⇒ StringWithConstraint
constructor
A new instance of StringWithConstraint.
- #to_s ⇒ Object
Constructor Details
#initialize(s) ⇒ StringWithConstraint
Returns a new instance of StringWithConstraint.
6 7 8 |
# File 'lib/sepa/base.rb', line 6 def initialize s self.string = constrain s end |
Instance Attribute Details
#string ⇒ Object
Returns the value of attribute string.
4 5 6 |
# File 'lib/sepa/base.rb', line 4 def string @string end |
Instance Method Details
#empty? ⇒ Boolean
10 11 12 |
# File 'lib/sepa/base.rb', line 10 def empty? (self.string == nil) || (self.string == '') end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/sepa/base.rb', line 14 def to_s self.string end |