Class: Sepa::StringWithConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/sepa/base.rb

Direct Known Subclasses

Max70Text

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#stringObject

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

Returns:

  • (Boolean)


10
11
12
# File 'lib/sepa/base.rb', line 10

def empty?
  (self.string == nil) || (self.string == '')
end

#to_sObject



14
15
16
# File 'lib/sepa/base.rb', line 14

def to_s
  self.string
end