Sha256: d2c874b3c3c6cb8906d1037155861d51041bf81dd0962d624b482597dbe1025f

Contents?: true

Size: 564 Bytes

Versions: 17

Compression:

Stored size: 564 Bytes

Contents

require 'forwardable'

module SuperTable
  class Record < Struct.new(:model)
    include ViewHelpers
    extend Forwardable

    class << self

      def property(attr_name)
        def_delegator :model, attr_name
      end
    end

    def helpers
      @helpers ||= Class.new do
        include ViewHelpers
      end.new
    end

    private

    def respond_to_missing?(name, include_private = false)
      model.respond_to?(name, include_private)
    end

    def method_missing(method, *args, &block)
      model.send(method, *args, &block)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
super_tools-2.1.0 lib/super_table/record.rb
super_tools-0.0.26 lib/super_table/record.rb
super_tools-0.0.25 lib/super_table/record.rb
super_tools-0.0.21 lib/super_table/record.rb
super_tools-0.0.20 lib/super_table/record.rb
super_tools-0.0.17 lib/super_table/record.rb
super_tools-0.0.15 lib/super_table/record.rb
super_tools-0.0.14 lib/super_table/record.rb
super_tools-0.0.13 lib/super_table/record.rb
super_tools-0.0.12 lib/super_table/record.rb
super_tools-0.0.11 lib/super_table/record.rb
super_tools-0.0.10 lib/super_table/record.rb
super_tools-0.0.9 lib/super_table/record.rb
super_tools-0.0.8 lib/super_table/record.rb
super_tools-0.0.7 lib/super_table/record.rb
super_tools-0.0.6 lib/super_table/record.rb
super_tools-0.0.5 lib/super_table/record.rb