Class: CopyBot::StepDefinitions

Inherits:
Object
  • Object
show all
Defined in:
lib/copy_bot/step_definitions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStepDefinitions

Returns a new instance of StepDefinitions.



6
7
8
# File 'lib/copy_bot/step_definitions.rb', line 6

def initialize
  @loaded_step_definitions = {}
end

Instance Attribute Details

#loaded_step_definitionsHash (readonly)

Returns:

  • (Hash)


4
5
6
# File 'lib/copy_bot/step_definitions.rb', line 4

def loaded_step_definitions
  @loaded_step_definitions
end

Instance Method Details

#load_step_definitions_file(step_definitions_file_path) ⇒ Hash

Parameters:

  • step_definitions_file_path (String)

Returns:

  • (Hash)


12
13
14
15
# File 'lib/copy_bot/step_definitions.rb', line 12

def load_step_definitions_file(step_definitions_file_path)
  @loaded_step_definitions = YAML.safe_load(ERB.new(File.read(step_definitions_file_path)).result)
                                 .deep_symbolize_keys
end

#stepsHash

Returns:

  • (Hash)


18
19
20
# File 'lib/copy_bot/step_definitions.rb', line 18

def steps
  loaded_step_definitions[:steps]
end