Class: Yema::Rule::Format
- Inherits:
-
Yema::Rule
- Object
- Yema::Rule
- Yema::Rule::Format
- Defined in:
- lib/yema/rule/format.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
Attributes inherited from Yema::Rule
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attribute_name, options = {}) ⇒ Format
constructor
A new instance of Format.
- #matches?(value) ⇒ Boolean
Methods inherited from Yema::Rule
Constructor Details
#initialize(attribute_name, options = {}) ⇒ Format
Returns a new instance of Format.
7 8 9 10 |
# File 'lib/yema/rule/format.rb', line 7 def initialize(attribute_name, ={}) super () end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
5 6 7 |
# File 'lib/yema/rule/format.rb', line 5 def format @format end |
Class Method Details
.required_options ⇒ Object
12 13 14 |
# File 'lib/yema/rule/format.rb', line 12 def self. [:format] end |
Instance Method Details
#matches?(value) ⇒ Boolean
16 17 18 |
# File 'lib/yema/rule/format.rb', line 16 def matches?(value) !!(format =~ value) end |