Class: ConvenientService::RSpec::PrimitiveMatchers::Classes::DelegateTo::Commands::GeneratePrintableMethod
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::RSpec::PrimitiveMatchers::Classes::DelegateTo::Commands::GeneratePrintableMethod
- Defined in:
- lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #call ⇒ Object
- #initialize(object:, method:) ⇒ void constructor
Methods inherited from Support::Command
Constructor Details
#initialize(object:, method:) ⇒ void
27 28 29 30 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb', line 27 def initialize(object:, method:) @object = object @method = method end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
20 21 22 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb', line 20 def method @method end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
14 15 16 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb', line 14 def object @object end |
Instance Method Details
#call ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb', line 32 def call case Utils::Object.resolve_type(object) when "class", "module" "#{object}.#{method}" when "instance" "#{object.class}##{method}" end end |