Sha256: d379fafd7e076f8f91b41348b2a6a93ff8ceadbbc3a98b76b01f72bc05c7e47d

Contents?: true

Size: 364 Bytes

Versions: 6

Compression:

Stored size: 364 Bytes

Contents

# encoding: utf-8

class Strike
  class Table
    def initialize(&block)
      @definition ||= {}
      yield self if block_given?
    end

    def method_missing(method, *args, &block)
      @definition[method] = block_given? ?  yield(self) : args.first

      true
    end

    def call
      to_hash
    end

    def to_hash
      @definition
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
strike-0.4.0 lib/strike/table.rb
strike-0.3.6 lib/strike/table.rb
strike-0.3.5 lib/strike/table.rb
strike-0.3.3 lib/strike/table.rb
strike-0.3.2 lib/strike/table.rb
strike-0.3.1 lib/strike/table.rb