Class: Karaden::Param::Message::MessageCancelParams

Inherits:
MessageParams
  • Object
show all
Defined in:
lib/karaden/param/message/message_cancel_params.rb

Constant Summary

Constants inherited from MessageParams

Karaden::Param::Message::MessageParams::CONTEXT_PATH

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMessageCancelParams

Returns a new instance of MessageCancelParams.



7
8
9
10
# File 'lib/karaden/param/message/message_cancel_params.rb', line 7

def initialize()
  @id = nil
  super
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/karaden/param/message/message_cancel_params.rb', line 5

def id
  @id
end

Class Method Details

.new_builderObject



38
39
40
# File 'lib/karaden/param/message/message_cancel_params.rb', line 38

def self.new_builder
  MessageCancelParamsBuilder.new
end

Instance Method Details

#to_pathObject



12
13
14
# File 'lib/karaden/param/message/message_cancel_params.rb', line 12

def to_path
  "#{CONTEXT_PATH}/#{@id}/cancel"
end

#validateObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/karaden/param/message/message_cancel_params.rb', line 16

def validate
  errors = Karaden::Model::KaradenObject.new
  has_error = false

  messages = validate_id
  unless messages.empty?
    errors.set_property('id', messages)
    has_error = true
  end

  if has_error
    e = Karaden::Exception::InvalidParamsException.new
    error = Karaden::Model::Error.new
    error.set_property('object', Karaden::Model::Error::OBJECT_NAME)
    error.set_property('errors', errors)
    e.error = error
    raise e
  end

  self
end