Skip to content

Commit

Permalink
Move add_features method to Rf module
Browse files Browse the repository at this point in the history
  • Loading branch information
buty4649 committed Jun 13, 2023
1 parent 041dd97 commit 4beb513
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions mrblib/rf/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Cli

def run(argv)
@config = Config.parse(argv)
Rf.add_features
Runner.run({
command: config.command,
filter:,
Expand Down
7 changes: 7 additions & 0 deletions mrblib/rf/features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ class Float

module Rf
class << self
def add_features
add_features_to_integer
add_features_to_float
add_features_to_hash
add_features_to_json
end

def add_features_to_integer
extend_op(Integer, :to_i)
end
Expand Down
8 changes: 0 additions & 8 deletions mrblib/rf/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,10 @@ def setup_container
end

def run
add_features
do_action
post_action
end

def add_features
Rf.add_features_to_integer
Rf.add_features_to_float
Rf.add_features_to_hash
Rf.add_features_to_json
end

def do_action
filter.each_record do |record, index, fields|
container.record = record
Expand Down

0 comments on commit 4beb513

Please sign in to comment.