Module: Castaway::Interpolation

Defined in:
lib/castaway/interpolation.rb,
lib/castaway/interpolation/linear.rb

Defined Under Namespace

Classes: Linear

Class Method Summary collapse

Class Method Details

._lookup_by_class(options) ⇒ Object



10
11
12
# File 'lib/castaway/interpolation.rb', line 10

def self._lookup_by_class(options)
  options[:interpolator]
end

._lookup_by_type(options) ⇒ Object



14
15
16
17
18
# File 'lib/castaway/interpolation.rb', line 14

def self._lookup_by_type(options)
  case options[:type]
  when :linear, nil then Castaway::Interpolation::Linear
  end
end

.lookup(options) ⇒ Object



4
5
6
7
8
# File 'lib/castaway/interpolation.rb', line 4

def self.lookup(options)
  _lookup_by_class(options) ||
    _lookup_by_type(options) ||
    raise(ArgumentError, "cannot find interpolation for #{value.inspect}")
end