Class: Dhall::TypeChecker::TextLiteral::Chunks

Inherits:
Object
  • Object
show all
Defined in:
lib/dhall/typecheck.rb

Instance Method Summary collapse

Constructor Details

#initialize(chunks) ⇒ Chunks

Returns a new instance of Chunks.



132
133
134
# File 'lib/dhall/typecheck.rb', line 132

def initialize(chunks)
	@chunks = chunks
end

Instance Method Details

#mapObject



136
137
138
139
140
141
142
143
144
# File 'lib/dhall/typecheck.rb', line 136

def map
	self.class.new(@chunks.map { |c|
		if c.is_a?(Dhall::Text)
			c
		else
			yield c
		end
	})
end

#to_aObject



146
147
148
# File 'lib/dhall/typecheck.rb', line 146

def to_a
	@chunks
end