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.



126
127
128
# File 'lib/dhall/typecheck.rb', line 126

def initialize(chunks)
  @chunks = chunks
end

Instance Method Details

#mapObject



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_aObject



140
141
142
# File 'lib/dhall/typecheck.rb', line 140

def to_a
  @chunks
end