Class: ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureUnstub

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_unstub.rb

Overview

Since:

  • 1.0.0

Instance Method Summary collapse

Constructor Details

#initialize(feature_class:, entry_name:) ⇒ void

Parameters:

Since:

  • 1.0.0



22
23
24
25
26
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_unstub.rb', line 22

def initialize(feature_class:, entry_name:)
  @feature_class = feature_class
  @entry_name = entry_name
  @arguments = nil
end

Instance Method Details

#==(other) ⇒ Boolean?

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)

Since:

  • 1.0.0



81
82
83
84
85
86
87
88
89
90
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_unstub.rb', line 81

def ==(other)
  return unless other.instance_of?(self.class)

  return false if feature_class != other.feature_class
  return false if entry_name != other.entry_name
  return false if arguments != other.arguments
  return false if value_unmock != other.value_unmock

  true
end

#to(value_unmock) ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureUnstub



62
63
64
65
66
67
68
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_unstub.rb', line 62

def to(value_unmock)
  @value_unmock = value_unmock.for(feature_class, entry_name, arguments)

  @value_unmock.register

  self
end

#to_return_value_mockConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::ValueUnmock



73
74
75
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_unstub.rb', line 73

def to_return_value_mock
  @value_unmock = Entities::ValueUnmock.new(feature_class: feature_class, entry_name: entry_name, arguments: arguments)
end

#with_any_argumentsConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureUnstub



43
44
45
46
47
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_unstub.rb', line 43

def with_any_arguments(...)
  @arguments = nil

  self
end

#with_argumentsConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureUnstub



31
32
33
34
35
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_unstub.rb', line 31

def with_arguments(...)
  @arguments = Support::Arguments.new(...)

  self
end

#without_argumentsConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureUnstub



52
53
54
55
56
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_unstub.rb', line 52

def without_arguments
  @arguments = Support::Arguments.null_arguments

  self
end