Class: Zakuro::Operation::Validator::Days
- Inherits:
-
Object
- Object
- Zakuro::Operation::Validator::Days
- Defined in:
- lib/zakuro/operation/month/validator.rb
Overview
Days 月日数(大小)
Constant Summary collapse
- NAME =
'days'
Instance Attribute Summary collapse
-
#dest ⇒ String
readonly
移動先.
-
#index ⇒ Integer
readonly
連番.
-
#src ⇒ String
readonly
移動元.
Instance Method Summary collapse
- #dest? ⇒ Boolean
-
#initialize(index:, yaml_hash: {}) ⇒ Days
constructor
初期化.
- #src? ⇒ Boolean
-
#validate ⇒ Array<String>
検証する.
Constructor Details
#initialize(index:, yaml_hash: {}) ⇒ Days
初期化
763 764 765 766 767 |
# File 'lib/zakuro/operation/month/validator.rb', line 763 def initialize(index:, yaml_hash: {}) @index = index @src = yaml_hash['src'] @dest = yaml_hash['dest'] end |
Instance Attribute Details
#dest ⇒ String (readonly)
Returns 移動先.
753 754 755 |
# File 'lib/zakuro/operation/month/validator.rb', line 753 def dest @dest end |
#index ⇒ Integer (readonly)
Returns 連番.
749 750 751 |
# File 'lib/zakuro/operation/month/validator.rb', line 749 def index @index end |
#src ⇒ String (readonly)
Returns 移動元.
751 752 753 |
# File 'lib/zakuro/operation/month/validator.rb', line 751 def src @src end |
Instance Method Details
#dest? ⇒ Boolean
790 791 792 |
# File 'lib/zakuro/operation/month/validator.rb', line 790 def dest? Types.month_days?(str: dest) end |
#src? ⇒ Boolean
786 787 788 |
# File 'lib/zakuro/operation/month/validator.rb', line 786 def src? Types.month_days?(str: src) end |
#validate ⇒ Array<String>
検証する
774 775 776 777 778 779 780 781 782 783 784 |
# File 'lib/zakuro/operation/month/validator.rb', line 774 def validate failed = [] prefix = "[#{index}][#{NAME}] invalid" failed.push("#{prefix} 'src'. #{src}") unless src? failed.push("#{prefix} 'dest'. #{dest}") unless dest? failed end |