Class: ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
- Inherits:
-
Object
- Object
- ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
- Defined in:
- lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_stub.rb
Overview
Instance Method Summary collapse
- #==(other) ⇒ Boolean?
- #initialize(feature_class:, entry_name:) ⇒ void constructor
- #to(value_mock) ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
- #to_return_value(value) ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::ValueMock
- #with_any_arguments ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
- #with_arguments ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
- #without_arguments ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
Constructor Details
#initialize(feature_class:, entry_name:) ⇒ void
22 23 24 25 26 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_stub.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?
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_stub.rb', line 82 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_mock != other.value_mock true end |
#to(value_mock) ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
62 63 64 65 66 67 68 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_stub.rb', line 62 def to(value_mock) @value_mock = value_mock.for(feature_class, entry_name, arguments) @value_mock.register self end |
#to_return_value(value) ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::ValueMock
74 75 76 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_stub.rb', line 74 def to_return_value(value) @value_mock = Entities::ValueMock.new(value: value, feature_class: feature_class, entry_name: entry_name, arguments: arguments) end |
#with_any_arguments ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
43 44 45 46 47 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_stub.rb', line 43 def with_any_arguments(...) @arguments = nil self end |
#with_arguments ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
31 32 33 34 35 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_stub.rb', line 31 def with_arguments(...) @arguments = Support::Arguments.new(...) self end |
#without_arguments ⇒ ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Entities::FeatureStub
52 53 54 55 56 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/entities/feature_stub.rb', line 52 def without_arguments @arguments = Support::Arguments.null_arguments self end |