Class: ActiveSet::Exporting::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/active_set/exporting/operation.rb

Instance Method Summary collapse

Constructor Details

#initialize(set, instructions_hash) ⇒ Operation

Returns a new instance of Operation.



8
9
10
11
# File 'lib/active_set/exporting/operation.rb', line 8

def initialize(set, instructions_hash)
  @set = set
  @instructions_hash = instructions_hash
end

Instance Method Details

#executeObject



13
14
15
16
17
# File 'lib/active_set/exporting/operation.rb', line 13

def execute
  strategy_for(format: operation_instructions[:format].to_s.downcase)
    .new(@set, operation_instructions[:columns])
    .execute
end

#operation_instructionsObject



19
20
21
# File 'lib/active_set/exporting/operation.rb', line 19

def operation_instructions
  @instructions_hash.symbolize_keys
end