Class: ConvenientService::Utils::Array::Wrap Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Array::Wrap
- Defined in:
- lib/convenient_service/utils/array/wrap.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #object ⇒ Object readonly private
-
#pad ⇒ Object
readonly
Can be any type.
Instance Method Summary collapse
- #call ⇒ Array private
- #initialize(object) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(object) ⇒ void
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.
22 23 24 |
# File 'lib/convenient_service/utils/array/wrap.rb', line 22 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
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.
16 17 18 |
# File 'lib/convenient_service/utils/array/wrap.rb', line 16 def object @object end |
#pad ⇒ Object (readonly)
Returns Can be any type.
16 |
# File 'lib/convenient_service/utils/array/wrap.rb', line 16 attr_reader :object |
Instance Method Details
#call ⇒ Array
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.
33 34 35 36 37 38 39 40 41 |
# File 'lib/convenient_service/utils/array/wrap.rb', line 33 def call if object.nil? [] elsif object.respond_to?(:to_ary) object.to_ary || [object] else [object] end end |