Module: Yaoc::Helper

Defined in:
lib/yaoc/helper/to_proc_delegator.rb,
lib/yaoc/helper/struct_hash_constructor.rb

Defined Under Namespace

Modules: StructHashConstructor Classes: ToProcDelegator

Class Method Summary collapse

Class Method Details

.StructH(*args, &block) ⇒ Object



20
21
22
23
24
# File 'lib/yaoc/helper/struct_hash_constructor.rb', line 20

def StructH(*args, &block)
  Struct.new(*args, &block).tap do|new_class|
    new_class.send(:include, Yaoc::Helper::StructHashConstructor)
  end
end

.StructHE(*args, &block) ⇒ Object



26
27
28
29
30
# File 'lib/yaoc/helper/struct_hash_constructor.rb', line 26

def StructHE(*args, &block)
  StructH(*args, &block).tap do|new_class|
    include Equalizer.new(*args)
  end
end