Class: Agave::Dump::Dsl::Root

Inherits:
Object
  • Object
show all
Includes:
AddToDataFile, CreateDataFile, CreatePost
Defined in:
lib/agave/dump/dsl/root.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AddToDataFile

#add_to_data_file

Methods included from CreatePost

#create_post

Methods included from CreateDataFile

#create_data_file

Constructor Details

#initialize(config_code, agave, operations) ⇒ Root

Returns a new instance of Root.



19
20
21
22
23
24
25
26
# File 'lib/agave/dump/dsl/root.rb', line 19

def initialize(config_code, agave, operations)
  @agave = agave
  @operations = operations

  # rubocop:disable Lint/Eval
  eval(config_code)
  # rubocop:enable Lint/Eval
end

Instance Attribute Details

#agaveObject (readonly)

Returns the value of attribute agave.



17
18
19
# File 'lib/agave/dump/dsl/root.rb', line 17

def agave
  @agave
end

#operationsObject (readonly)

Returns the value of attribute operations.



17
18
19
# File 'lib/agave/dump/dsl/root.rb', line 17

def operations
  @operations
end

Instance Method Details

#directory(path, &block) ⇒ Object



28
29
30
31
32
33
# File 'lib/agave/dump/dsl/root.rb', line 28

def directory(path, &block)
  operation = Operation::Directory.new(operations, path)
  operations.add operation

  Directory.new(agave, operation, &block)
end