Class: AsgDetailer::Detailer

Inherits:
Object
  • Object
show all
Defined in:
lib/asg-detailer/detailer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Detailer

Returns a new instance of Detailer.



10
11
12
13
14
# File 'lib/asg-detailer/detailer.rb', line 10

def initialize(name, options = {})
  @name = name
  @data = nil
  @infra = Infra.new
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



8
9
10
# File 'lib/asg-detailer/detailer.rb', line 8

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/asg-detailer/detailer.rb', line 7

def name
  @name
end

Instance Method Details

#jsonObject



25
26
27
28
# File 'lib/asg-detailer/detailer.rb', line 25

def json
  self.run
  @data ? @data.to_json : nil
end

#json_prettyObject



30
31
32
33
# File 'lib/asg-detailer/detailer.rb', line 30

def json_pretty
  self.run
  puts JSON.pretty_generate(@data)
end


20
21
22
23
# File 'lib/asg-detailer/detailer.rb', line 20

def print
  self.run
  print_details
end

#runObject



16
17
18
# File 'lib/asg-detailer/detailer.rb', line 16

def run
  detail_asg
end