Class: Refocus::ResourcesSyncCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/refocus/cli/resources.rb

Instance Method Summary collapse

Methods inherited from BaseCommand

#aspects, #refocus, #samples, #subjects

Instance Method Details

#executeObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/refocus/cli/resources.rb', line 14

def execute
  input_subjects.each do |subject|
    subjects.send(action, {
      name: subject.fetch("name"),
      options: subject.fetch("properties")
    })
  end

  input_aspects.each do |aspect|
    aspects.send(action, {
      name: aspect.fetch("name"),
      options: aspect.fetch("properties")
    })
  end
end

#inputObject



30
31
32
# File 'lib/refocus/cli/resources.rb', line 30

def input
  @input ||= YAML.safe_load(STDIN.read)
end

#input_aspectsObject



38
39
40
# File 'lib/refocus/cli/resources.rb', line 38

def input_aspects
  input["aspects"] || []
end

#input_subjectsObject



34
35
36
# File 'lib/refocus/cli/resources.rb', line 34

def input_subjects
  input["subjects"] || []
end