Class: ConvenientService::Utils::Object::DuckClass
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Object::DuckClass
- Defined in:
- lib/convenient_service/utils/object/duck_class.rb
Overview
TODO: A better name.
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #call ⇒ Class
-
#initialize(object) ⇒ DuckClass
constructor
A new instance of DuckClass.
Methods inherited from Support::Command
Constructor Details
#initialize(object) ⇒ DuckClass
Returns a new instance of DuckClass.
99 100 101 |
# File 'lib/convenient_service/utils/object/duck_class.rb', line 99 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
94 95 96 |
# File 'lib/convenient_service/utils/object/duck_class.rb', line 94 def object @object end |
Instance Method Details
#call ⇒ Class
106 107 108 |
# File 'lib/convenient_service/utils/object/duck_class.rb', line 106 def call object.is_a?(::Module) ? object.singleton_class : object.class end |