Module: Validate
- Included in:
- Unifmt
- Defined in:
- lib/ebngen/unifmt.rb
Instance Method Summary collapse
- #get_validate(name) ⇒ Object
- #validate(name, value) ⇒ Object
- #validate_array(name) ⇒ Object
- #validate_hash(name) ⇒ Object
- #validate_string(name) ⇒ Object
Instance Method Details
#get_validate(name) ⇒ Object
46 47 48 49 50 |
# File 'lib/ebngen/unifmt.rb', line 46 def get_validate(name) if @validate_hash.has_key?(name) return @validate_hash[name] end end |
#validate(name, value) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/ebngen/unifmt.rb', line 39 def validate(name, value) if @validate_hash.has_key?(name) return @validate_hash[name] == value.class end true end |
#validate_array(name) ⇒ Object
24 25 26 27 |
# File 'lib/ebngen/unifmt.rb', line 24 def validate_array(name) @validate_hash = Hash.new if @validate_hash.nil? @validate_hash[name] = Array end |
#validate_hash(name) ⇒ Object
34 35 36 37 |
# File 'lib/ebngen/unifmt.rb', line 34 def validate_hash(name) @validate_hash = Hash.new if @validate_hash.nil? @validate_hash[name] = Hash end |
#validate_string(name) ⇒ Object
29 30 31 32 |
# File 'lib/ebngen/unifmt.rb', line 29 def validate_string(name) @validate_hash = Hash.new if @validate_hash.nil? @validate_hash[name] = String end |