Method: Cfer::BlockHash#method_missing

Defined in:
lib/cfer/block.rb

#method_missing(method_sym, *arguments, &block) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/cfer/block.rb', line 86

def method_missing(method_sym, *arguments, &block)
  key = camelize_property(method_sym)
  properties key =>
    case arguments.size
    when 0
      if block
        BlockHash.new.build_from_block(&block)
      else
        raise "Expected a value or block when setting property #{key}"
      end
    when 1
      arguments.first
    else
      arguments
    end
end