Module: Fcoin::ValidatorUtility
- Included in:
- MarketValidator, Orders::CreateOrderLimitValidator, Orders::CreateOrderMarketValidator, Orders::OrderListValidator
- Defined in:
- lib/fcoin/validator/validator_utility.rb
Instance Method Summary collapse
- #between_error_message(target, target_type, min, max) ⇒ Object
- #includes_error_message(target, target_type, list) ⇒ Object
- #presence_error_message(target, target_type) ⇒ Object
Instance Method Details
#between_error_message(target, target_type, min, max) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/fcoin/validator/validator_utility.rb', line 10 def (target, target_type, min, max) = {} target_value = target.present? ? target : 'nil' [target_type] = "#{target_type} is #{target_value}. #{target_type} is not between #{min} and #{max}." end |
#includes_error_message(target, target_type, list) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/fcoin/validator/validator_utility.rb', line 3 def (target, target_type, list) = {} target_value = target.present? ? target : 'nil' [target_type] = "#{target_type} is #{target_value}. #{target_type} is not included in the [#{list.join(', ')}]." end |
#presence_error_message(target, target_type) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/fcoin/validator/validator_utility.rb', line 17 def (target, target_type) = {} target_value = target.present? ? target : 'nil' [target_type] = "#{target_type} is #{target_value}. #{target_type} can't be blank" end |