Class: ConvenientService::Examples::Standard::V1::RequestParams::Utils::Array::Wrap
- Inherits:
-
Command
- Object
- ConvenientService::Examples::Standard::V1::RequestParams::Utils::Array::Wrap
- Defined in:
- lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#pad ⇒ Object
readonly
Can be any type.
Instance Method Summary collapse
- #call ⇒ Array
- #initialize(object) ⇒ void constructor
Constructor Details
#initialize(object) ⇒ void
26 27 28 |
# File 'lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb', line 26 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
20 21 22 |
# File 'lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb', line 20 def object @object end |
#pad ⇒ Object (readonly)
Returns Can be any type.
20 |
# File 'lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb', line 20 attr_reader :object |
Instance Method Details
#call ⇒ Array
37 38 39 40 41 42 43 44 45 |
# File 'lib/convenient_service/examples/standard/v1/request_params/utils/array/wrap.rb', line 37 def call if object.nil? [] elsif object.respond_to?(:to_ary) object.to_ary || [object] else [object] end end |