Class: Zakuro::Operation::Validator::Leaped
- Inherits:
-
Object
- Object
- Zakuro::Operation::Validator::Leaped
- Defined in:
- lib/zakuro/operation/month/validator.rb
Overview
Leaped 閏有無
Constant Summary collapse
- NAME =
'leaped'
Instance Attribute Summary collapse
-
#dest ⇒ String
readonly
移動先.
-
#index ⇒ Integer
readonly
連番.
-
#src ⇒ String
readonly
移動元.
Instance Method Summary collapse
- #dest? ⇒ Boolean
-
#initialize(index:, yaml_hash: {}) ⇒ Leaped
constructor
初期化.
- #src? ⇒ Boolean
-
#validate ⇒ Array<String>
検証する.
Constructor Details
#initialize(index:, yaml_hash: {}) ⇒ Leaped
初期化
710 711 712 713 714 |
# File 'lib/zakuro/operation/month/validator.rb', line 710 def initialize(index:, yaml_hash: {}) @index = index @src = yaml_hash['src'] @dest = yaml_hash['dest'] end |
Instance Attribute Details
#dest ⇒ String (readonly)
Returns 移動先.
700 701 702 |
# File 'lib/zakuro/operation/month/validator.rb', line 700 def dest @dest end |
#index ⇒ Integer (readonly)
Returns 連番.
696 697 698 |
# File 'lib/zakuro/operation/month/validator.rb', line 696 def index @index end |
#src ⇒ String (readonly)
Returns 移動元.
698 699 700 |
# File 'lib/zakuro/operation/month/validator.rb', line 698 def src @src end |
Instance Method Details
#dest? ⇒ Boolean
737 738 739 |
# File 'lib/zakuro/operation/month/validator.rb', line 737 def dest? Types.empiable_bool?(str: dest) end |
#src? ⇒ Boolean
733 734 735 |
# File 'lib/zakuro/operation/month/validator.rb', line 733 def src? Types.empiable_bool?(str: src) end |
#validate ⇒ Array<String>
検証する
721 722 723 724 725 726 727 728 729 730 731 |
# File 'lib/zakuro/operation/month/validator.rb', line 721 def validate failed = [] prefix = "[#{index}][#{NAME}] invalid" failed.push("#{prefix} 'src'. #{src}") unless src? failed.push("#{prefix} 'dest'. #{dest}") unless dest? failed end |