Class: ProconBypassMan::RemoteAction::RemoteActionObject

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/remote_action/remote_action_object.rb

Defined Under Namespace

Classes: MustBeNotNilError, NonSupportAction, ValidationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, uuid:, steps:) ⇒ RemoteActionObject

Returns a new instance of RemoteActionObject.

Parameters:

  • name (String)
  • uuid (String)
  • steps (Array)


12
13
14
15
16
17
# File 'lib/procon_bypass_man/remote_action/remote_action_object.rb', line 12

def initialize(name: , uuid:, steps: )
  @name = name
  @uuid = uuid
  @steps = steps
  freeze
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/procon_bypass_man/remote_action/remote_action_object.rb', line 7

def name
  @name
end

#stepsObject

Returns the value of attribute steps.



7
8
9
# File 'lib/procon_bypass_man/remote_action/remote_action_object.rb', line 7

def steps
  @steps
end

#uuidObject

Returns the value of attribute uuid.



7
8
9
# File 'lib/procon_bypass_man/remote_action/remote_action_object.rb', line 7

def uuid
  @uuid
end

Instance Method Details

#validate!void

This method returns an undefined value.



22
23
24
25
26
27
# File 'lib/procon_bypass_man/remote_action/remote_action_object.rb', line 22

def validate!
  self.uuid or raise MustBeNotNilError, "uuidは値が必須です"
  unless self.steps.is_a?(Array)
    raise ValidationError, "stepsは配列です"
  end
end