Class: Stitches::Configuration::NonNullString
- Inherits:
-
Object
- Object
- Stitches::Configuration::NonNullString
- Defined in:
- lib/stitches/configuration.rb
Instance Method Summary collapse
-
#initialize(name, string) ⇒ NonNullString
constructor
A new instance of NonNullString.
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(name, string) ⇒ NonNullString
Returns a new instance of NonNullString.
99 100 101 102 103 104 105 106 107 |
# File 'lib/stitches/configuration.rb', line 99 def initialize(name,string) unless string.nil? || string.is_a?(String) raise "#{name} must be a String, not a #{string.class}" end if String(string).strip.length == 0 raise "#{name} may not be blank" end @string = string end |
Instance Method Details
#to_s ⇒ Object Also known as: to_str
109 110 111 |
# File 'lib/stitches/configuration.rb', line 109 def to_s @string end |