Sha256: da859b6a3a597a7d279d3ffd03189cef079d02dd03d545ac08684e504773829f
Contents?: true
Size: 576 Bytes
Versions: 18
Compression:
Stored size: 576 Bytes
Contents
module Pickle module Session # add ability to parse model names as fields, using a session module Parser def self.included(parser_class) parser_class.alias_method_chain :parse_field, :model end attr_accessor :session def match_field "(?:\\w+: (?:#{match_model}|#{match_value}))" end def parse_field_with_model(field) if session && field =~ /^(\w+): #{capture_model}$/ {$1 => session.model($2)} else parse_field_without_model(field) end end end end end
Version data entries
18 entries across 18 versions & 3 rubygems