Class: Refocus::ResourcesSyncCommand
Instance Method Summary
collapse
Methods inherited from BaseCommand
#aspects, #refocus, #samples, #subjects
Instance Method Details
#execute ⇒ Object
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
|
30
31
32
|
# File 'lib/refocus/cli/resources.rb', line 30
def input
@input ||= YAML.safe_load(STDIN.read)
end
|
38
39
40
|
# File 'lib/refocus/cli/resources.rb', line 38
def input_aspects
input["aspects"] || []
end
|
34
35
36
|
# File 'lib/refocus/cli/resources.rb', line 34
def input_subjects
input["subjects"] || []
end
|