lib/phony/dsl.rb
def one_of *ndcs
      options = Hash === ndcs.last ? ndcs.pop : {}

      # Ruby 1.8 compatibility mode.
      #
      ndcs = ndcs.first if Array === ndcs.first

      NationalSplitters::Variable.new options[:max_length], ndcs
    end
# If you have a number of (possibly) variable length NDCs
# that cannot be well expressed via regexp, use this.
#
# Parameters:
#   * ndcs A list of ndcs of variable length.
#   * Can contain :max_length => number to denote a maximum NDC length.
#
# Example:
#   country '51', one_of('103', '105') >> split(3,3) # If it's either 103 or 105, then split ...
#
If you have a number of (possibly) variable length NDCs
that cannot be well expressed via regexp, use this.

ndcs A list of ndcs of variable length.
Can contain :max_length => number to denote a maximum NDC length.


If you have a number of ( possibly ) variable length NDCs that cannot be well expressed via regexp use this . ndcs A list of ndcs of variable length . Can contain : max_length = > number to denote a maximum NDC length .
def one_of *ndcs
      options = Hash === ndcs.last ? ndcs.pop : {}
      ndcs = ndcs.first if Array === ndcs.first
      NationalSplitters::Variable.new options[:max_length], ndcs
    end
def one_of * ndcs options = Hash === ndcs . last ? ndcs . pop : { } ndcs = ndcs . first if Array === ndcs . first NationalSplitters :: Variable . new options [ :max_length ] , ndcs end
If you have a number of (possibly) variable length NDCs
that cannot be well expressed via regexp, use this.
If you have a number of ( possibly ) variable length NDCs that cannot be well expressed via regexp use this .
# Ruby 1.8 compatibility mode. #
ndcs