Class: Rasti::Types::String
- Inherits:
-
Object
- Object
- Rasti::Types::String
- Extended by:
- Castable
- Defined in:
- lib/rasti/types/string.rb
Class Method Summary collapse
- .[](format) ⇒ Object
- .to_s ⇒ Object (also: inspect)
Methods included from Castable
Class Method Details
.[](format) ⇒ Object
8 9 10 11 12 |
# File 'lib/rasti/types/string.rb', line 8 def [](format) Class.new(self) do @format = format.is_a?(::String) ? ::Regexp.new(format) : format end end |
.to_s ⇒ Object Also known as: inspect
14 15 16 |
# File 'lib/rasti/types/string.rb', line 14 def to_s name || "#{superclass.name}[#{format.inspect}]" end |