Skip to content

Commit b1ec681

Browse files
committed
remove save_data and load_data dsl
1 parent ba0511f commit b1ec681

File tree

3 files changed

+0
-30
lines changed

3 files changed

+0
-30
lines changed

Diff for: README.md

-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ DSLs are as follows
7878
* [add_snippet](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#add_snippet-instance_method) - call another rewriter
7979
* [call_helper](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#call_helper-instance_method) - call a shared rewriter
8080
* [with_configurations](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#with_configurations-instance_method) - execute a block of code with temporary configurations
81-
* [save_data](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#save_data-instance_method) - save data
82-
* [load_data](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#load_data-instance_method) - load data
8381

8482
Scopes:
8583

Diff for: lib/synvert/core/rewriter.rb

-16
Original file line numberDiff line numberDiff line change
@@ -416,22 +416,6 @@ def with_configurations(configurations, &block)
416416
Configuration.with_temporary_configurations(configurations, &block)
417417
end
418418

419-
# Saves data with a given key and value.
420-
#
421-
# @param key [Symbol] the key to identify the data
422-
# @param value [Object] the value to be saved
423-
def save_data(key, value)
424-
Synvert::Core.instance_variable_set("@#{key}", value)
425-
end
426-
427-
# Loads data with the given key.
428-
#
429-
# @param key [Symbol] the key of the data to be loaded
430-
# @return [Object] the data loaded
431-
def load_data(key)
432-
Synvert::Core.instance_variable_get("@#{key}")
433-
end
434-
435419
private
436420

437421
# Handle one file.

Diff for: spec/synvert/core/rewriter_spec.rb

-12
Original file line numberDiff line numberDiff line change
@@ -395,18 +395,6 @@ module Synvert::Core
395395
expect(instance.dynamic_helper('arg1', 'arg2')).to eq 'dynamic result'
396396
end
397397

398-
it 'parses save_data and load_data' do
399-
data = nil
400-
rewriter =
401-
Rewriter.new 'group', 'name' do
402-
hash = { foo: 'bar' }
403-
save_data :object, hash
404-
data = load_data :object
405-
end
406-
rewriter.process
407-
expect(data).to eq({ foo: 'bar' })
408-
end
409-
410398
describe 'class methods' do
411399
before :each do
412400
Rewriter.clear

0 commit comments

Comments
 (0)