Class: JsonStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/hyrax/specs/shared_specs/factories/strategies/json_strategy.rb

Instance Method Summary collapse

Constructor Details

#initializeJsonStrategy

Returns a new instance of JsonStrategy.



4
5
6
# File 'lib/hyrax/specs/shared_specs/factories/strategies/json_strategy.rb', line 4

def initialize
  @strategy = FactoryBot.strategy_by_name(:create).new
end

Instance Method Details

#result(evaluation) ⇒ Object



10
11
12
# File 'lib/hyrax/specs/shared_specs/factories/strategies/json_strategy.rb', line 10

def result(evaluation)
  @strategy.result(evaluation).to_json
end

#to_symObject



14
15
16
# File 'lib/hyrax/specs/shared_specs/factories/strategies/json_strategy.rb', line 14

def to_sym
  :json
end