Module: ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message::Concern::ClassMethods

Defined in:
lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#===(other) ⇒ Boolean?

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)


38
39
40
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/class_methods.rb', line 38

def ===(other)
  Commands::IsMessage.call(message: other) || super
end

#cast(other) ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message?



19
20
21
22
23
24
25
26
27
28
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/class_methods.rb', line 19

def cast(other)
  case other
  when ::String
    new(value: other)
  when ::Symbol
    new(value: other.to_s)
  when Message
    new(value: other.value)
  end
end