Sha256: 0f50dc3c2da87f5f5ad235466101c9058efd295dad55a933fdb2c70cf6e314d9
Contents?: true
Size: 770 Bytes
Versions: 8
Compression:
Stored size: 770 Bytes
Contents
class ProconBypassMan::RemoteAction::RemoteActionObject # valueobjectがvalidatorの責務も持っている. 今度分離する class ValidationError < StandardError; end class MustBeNotNilError < ValidationError; end class NonSupportAction < ValidationError; end attr_accessor :name, :uuid, :steps # @param [String] name # @param [String] uuid # @param [Array] steps def initialize(name: , uuid:, steps: ) @name = name @uuid = uuid @steps = steps freeze end # @raise [MustBeNotNilError] # @raise [NonSupportAction] # @return [void] def validate! self.uuid or raise MustBeNotNilError, "uuidは値が必須です" unless self.steps.is_a?(Array) raise ValidationError, "stepsは配列です" end end end
Version data entries
8 entries across 8 versions & 1 rubygems