Class: Dhall::TypeChecker::TextLiteral::Chunks
- Inherits:
-
Object
- Object
- Dhall::TypeChecker::TextLiteral::Chunks
- Defined in:
- lib/dhall/typecheck.rb
Instance Method Summary collapse
-
#initialize(chunks) ⇒ Chunks
constructor
A new instance of Chunks.
- #map ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(chunks) ⇒ Chunks
Returns a new instance of Chunks.
126 127 128 |
# File 'lib/dhall/typecheck.rb', line 126 def initialize(chunks) @chunks = chunks end |
Instance Method Details
#map ⇒ Object
130 131 132 133 134 135 136 137 138 |
# File 'lib/dhall/typecheck.rb', line 130 def map self.class.new(@chunks.map { |c| if c.is_a?(Dhall::Text) c else yield c end }) end |
#to_a ⇒ Object
140 141 142 |
# File 'lib/dhall/typecheck.rb', line 140 def to_a @chunks end |