class Zakuro::Operation::Validator::Days
Days
月日数(大小)
Constants
- NAME
Attributes
actual[R]
@return [String] 運用
calc[R]
@return [String] 計算
index[R]
@return [Integer] 連番
Public Class Methods
new(index:, yaml_hash: {})
click to toggle source
初期化
@param [Integer] index 連番 @param [Hash<String, String>] yaml_hash yaml @option yaml_hash [String] :calc 計算 @option yaml_hash [String] :actual 運用
# File lib/zakuro/operation/month/validator.rb, line 755 def initialize(index:, yaml_hash: {}) @index = index @calc = yaml_hash['calc'] @actual = yaml_hash['actual'] end
Public Instance Methods
actual?()
click to toggle source
# File lib/zakuro/operation/month/validator.rb, line 782 def actual? Types.month_days?(str: @actual) end
calc?()
click to toggle source
# File lib/zakuro/operation/month/validator.rb, line 778 def calc? Types.month_days?(str: @calc) end
validate()
click to toggle source
検証する
@return [Array<String>] エラーメッセージ
# File lib/zakuro/operation/month/validator.rb, line 766 def validate failed = [] prefix = "[#{@index}][#{NAME}] invalid" failed.push("#{prefix} 'calc'. #{@calc}") unless calc? failed.push("#{prefix} 'actual'. #{@actual}") unless actual? failed end