Class: Hanami::RSpec::Generators::Operation Private
- Inherits:
-
Object
- Object
- Hanami::RSpec::Generators::Operation
- Defined in:
- lib/hanami/rspec/generators/operation.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #fs ⇒ Object readonly private
- #inflector ⇒ Object readonly private
Instance Method Summary collapse
- #call(key:, namespace:, base_path:) ⇒ Object private
-
#initialize(fs:, inflector:) ⇒ Operation
constructor
private
A new instance of Operation.
Constructor Details
#initialize(fs:, inflector:) ⇒ Operation
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Operation.
12 13 14 15 |
# File 'lib/hanami/rspec/generators/operation.rb', line 12 def initialize(fs:, inflector:) @fs = fs @inflector = inflector end |
Instance Attribute Details
#fs ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/rspec/generators/operation.rb', line 10 def fs @fs end |
#inflector ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/hanami/rspec/generators/operation.rb', line 10 def inflector @inflector end |
Instance Method Details
#call(key:, namespace:, base_path:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 20 21 22 23 |
# File 'lib/hanami/rspec/generators/operation.rb', line 17 def call(key:, namespace:, base_path:) operation_class_file = operation_class_file(key:, namespace:, base_path:) spec_file_path = operation_class_file.path.gsub(/\.rb$/, "_spec.rb") operation_class_name = operation_class_file.fully_qualified_name fs.write(spec_file_path, spec_content(operation_class_name)) end |