Class: Etna::Cwl::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/etna/cwl.rb

Instance Method Summary collapse

Instance Method Details

#as_arrayObject



56
57
58
# File 'lib/etna/cwl.rb', line 56

def as_array
  ArrayLoader.new(self)
end

#as_mapped_array(id_key = nil, value_key = nil) ⇒ Object



48
49
50
# File 'lib/etna/cwl.rb', line 48

def as_mapped_array(id_key = nil, value_key = nil)
  MapLoader.new(self.as_array, id_key, value_key)
end

#load(val) ⇒ Object



36
37
38
# File 'lib/etna/cwl.rb', line 36

def load(val)
  raise "Unimplemented"
end

#map(&block) ⇒ Object



44
45
46
# File 'lib/etna/cwl.rb', line 44

def map(&block)
  FunctorMapLoader.new(self, &block)
end

#optionalObject



40
41
42
# File 'lib/etna/cwl.rb', line 40

def optional
  OptionalLoader.new(self)
end

#or(*alternatives) ⇒ Object



52
53
54
# File 'lib/etna/cwl.rb', line 52

def or(*alternatives)
  UnionLoader.new(self, *alternatives)
end