Class: AsgDetailer::Detailer
- Inherits:
-
Object
- Object
- AsgDetailer::Detailer
- Defined in:
- lib/asg-detailer/detailer.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Detailer
constructor
A new instance of Detailer.
- #json ⇒ Object
- #json_pretty ⇒ Object
- #print ⇒ Object
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/asg-detailer/detailer.rb', line 8 def data @data end |
#name ⇒ Object (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
#json ⇒ Object
25 26 27 28 |
# File 'lib/asg-detailer/detailer.rb', line 25 def json self.run @data ? @data.to_json : nil end |
#json_pretty ⇒ Object
30 31 32 33 |
# File 'lib/asg-detailer/detailer.rb', line 30 def json_pretty self.run puts JSON.pretty_generate(@data) end |
#print ⇒ Object
20 21 22 23 |
# File 'lib/asg-detailer/detailer.rb', line 20 def print self.run print_details end |
#run ⇒ Object
16 17 18 |
# File 'lib/asg-detailer/detailer.rb', line 16 def run detail_asg end |