Class: ConvenientService::Common::Plugins::HasCallbacks::Entities::TypeCollection
- Inherits:
-
Object
- Object
- ConvenientService::Common::Plugins::HasCallbacks::Entities::TypeCollection
- Defined in:
- lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
Instance Attribute Summary collapse
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #contain_exactly?(other_types) ⇒ Boolean
-
#initialize(types:) ⇒ TypeCollection
constructor
A new instance of TypeCollection.
Constructor Details
#initialize(types:) ⇒ TypeCollection
Returns a new instance of TypeCollection.
11 12 13 |
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb', line 11 def initialize(types:) @types = types.map(&Entities::Type.method(:cast!)) end |
Instance Attribute Details
#types ⇒ Object (readonly)
Returns the value of attribute types.
9 10 11 |
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb', line 9 def types @types end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb', line 21 def ==(other) return unless other.instance_of?(self.class) return false if types != other.types true end |
#contain_exactly?(other_types) ⇒ Boolean
15 16 17 18 19 |
# File 'lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb', line 15 def contain_exactly?(other_types) other_types = other_types.map(&Entities::Type.method(:cast!)) Utils::Array.contain_exactly?(types, other_types) end |