Module: AWS::Core::OptionGrammar::Descriptors::Pattern

Defined in:
lib/aws/core/option_grammar.rb

Class Method Summary collapse

Class Method Details

.apply(*args) ⇒ Object

def validate value, context = nil

  unless value =~ regex
    raise format_error("value to match #{regex}", context)
  end
end

def self.apply option, regex
  option.extend(self)
  MetaUtils.extend_method(option, :regex) { regex }
end


182
183
# File 'lib/aws/core/option_grammar.rb', line 182

def self.apply *args
end