Class: Refocus::GetSampleCommand

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

Instance Method Summary collapse

Methods inherited from BaseCommand

#aspects, #refocus, #samples, #subjects

Instance Method Details

#aspectObject



25
26
27
# File 'lib/refocus/cli/samples.rb', line 25

def aspect
  sample_array.last
end

#executeObject



13
14
15
# File 'lib/refocus/cli/samples.rb', line 13

def execute
  puts JSON.pretty_generate(Refocus.client.samples.get(subject: subject, aspect: aspect))
end

#sample_arrayObject



17
18
19
# File 'lib/refocus/cli/samples.rb', line 17

def sample_array
  sample.split("|")
end

#subjectObject



21
22
23
# File 'lib/refocus/cli/samples.rb', line 21

def subject
  sample_array.first
end