Class: Lbrt::Service
- Inherits:
-
Object
- Object
- Lbrt::Service
- Includes:
- Logger::Helper
- Defined in:
- lib/lbrt/service.rb
Defined Under Namespace
Instance Method Summary collapse
- #apply(file) ⇒ Object
- #export(export_options = {}) ⇒ Object
-
#initialize(client, options = {}) ⇒ Service
constructor
A new instance of Service.
- #list ⇒ Object
Methods included from Logger::Helper
Constructor Details
Instance Method Details
#apply(file) ⇒ Object
32 33 34 |
# File 'lib/lbrt/service.rb', line 32 def apply(file) walk(file) end |
#export(export_options = {}) ⇒ Object
27 28 29 30 |
# File 'lib/lbrt/service.rb', line 27 def export( = {}) exported = Lbrt::Service::Exporter.export(@client, @options) Lbrt::Service::DSL.convert(exported, @options) end |
#list ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lbrt/service.rb', line 4 def list json = {} service_by_key = build_service_by_key service_by_key.each do |service_key, srvc| service_id = srvc.delete('id') type, title = service_key json[service_id] = { type: type, title: title, }.merge(srvc) end puts JSON.pretty_generate(json) end |