Module: ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data::Concern::ClassMethods Private
- Defined in:
- lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #===(other) ⇒ Boolean? private
- #cast(other) ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data? private
-
#data?(data) ⇒ Boolean
Checks whether an object is a data instance.
-
#data_class?(data_class) ⇒ Boolean
Checks whether an object is a data class.
Instance Method Details
#===(other) ⇒ Boolean?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
115 116 117 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb', line 115 def ===(other) data?(other) || super end |
#cast(other) ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
98 99 100 101 102 103 104 105 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb', line 98 def cast(other) case other when ::Hash new(value: other.transform_keys(&:to_sym)) when Data new(value: other.__value__) end end |
#data?(data) ⇒ Boolean
Checks whether an object is a data instance.
90 91 92 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb', line 90 def data?(data) data_class?(data.class) end |
#data_class?(data_class) ⇒ Boolean
Checks whether an object is a data class.
52 53 54 55 56 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/class_methods.rb', line 52 def data_class?(data_class) return false unless data_class.instance_of?(::Class) data_class.include?(Entities::Data::Concern) end |