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
32 33 34 35 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb', line 32 def initialize(object:, method:) @object = object @method = method end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
25 26 27 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb', line 25 def method @method end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
19 20 21 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb', line 19 def object @object end |
Instance Method Details
#call ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb', line 37 def call case Utils::Object.resolve_type(object) when "class", "module" "#{object}.#{method}" when "instance" "#{object.class}##{method}" end end |