Class: Monolens::Lens::Signature

Inherits:
Object
  • Object
show all
Defined in:
lib/monolens/lens/signature.rb,
lib/monolens/lens/signature/missing.rb

Direct Known Subclasses

Missing

Defined Under Namespace

Classes: Missing

Constant Summary collapse

MISSING =
Missing.new

Instance Method Summary collapse

Constructor Details

#initialize(input, output, options) ⇒ Signature

Returns a new instance of Signature.



8
9
10
11
12
# File 'lib/monolens/lens/signature.rb', line 8

def initialize(input, output, options)
  @input = input
  @output = output
  @options = symbolize(options)
end

Instance Method Details

#dress_options(options, registry) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/monolens/lens/signature.rb', line 14

def dress_options(options, registry)
  case options
  when ::Hash
    _dress_options(options.dup, registry)
  when ::Array
    dress_options({lenses: options}, registry)
  when ::String
    dress_options({lenses: [options]}, registry)
  else
    raise Error, "Invalid options `#{options.to_json}`"
  end
end