Sha256: ff90c3f934081b9d419fad7a846c8f6bcdae78a184f956ce951d07d524541365

Contents?: true

Size: 428 Bytes

Versions: 1

Compression:

Stored size: 428 Bytes

Contents

module Tableview::Helper
  
  class Format
    def initialize(p)
      @params = p
    end
    
    def html?
      @params[:format] == :html || @params[:format].blank?
    end
    
    def method_missing(name, *args, &blk)
      puts name.inspect
      if m = name.to_s.match(/^(.+)\?$/)
        puts m.inspect, name.inspect
        @params[:format] == m.captures.first
      else
        super
      end
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tableview-0.3.2 lib/tableview/helper.rb