Class: Crystal::Params

Inherits:
OpenObject
  • Object
show all
Defined in:
lib/crystal/conveyor/params.rb

Instance Method Summary collapse

Constructor Details

#initialize(h = nil) ⇒ Params

include OpenConstructor



5
6
7
8
9
10
11
# File 'lib/crystal/conveyor/params.rb', line 5

def initialize h = nil      
  if h and (format = h.delete('format') || h.delete(:format))
    h = h.clone
    h[:format] = Format.new(format.to_s) 
  end
  update h if h
end

Instance Method Details

#format=(value) ⇒ Object



13
14
15
# File 'lib/crystal/conveyor/params.rb', line 13

def format= value
  self[:format] = Format.new value
end

#inspectObject



17
18
19
20
# File 'lib/crystal/conveyor/params.rb', line 17

def inspect      
  h = to_h
  h.inspect
end