Class: Lbrt::Space
Defined Under Namespace
Instance Method Summary collapse
- #apply(file) ⇒ Object
- #export(export_options = {}) ⇒ Object
-
#initialize(client, options = {}) ⇒ Space
constructor
A new instance of Space.
- #list ⇒ Object
- #peco ⇒ Object
Methods included from Logger::Helper
Constructor Details
#initialize(client, options = {}) ⇒ Space
Returns a new instance of Space.
4 5 6 7 8 |
# File 'lib/lbrt/space.rb', line 4 def initialize(client, = {}) @client = client = @driver = Lbrt::Driver.new(@client, ) end |
Instance Method Details
#apply(file) ⇒ Object
39 40 41 |
# File 'lib/lbrt/space.rb', line 39 def apply(file) walk(file) end |
#export(export_options = {}) ⇒ Object
34 35 36 37 |
# File 'lib/lbrt/space.rb', line 34 def export( = {}) exported = Lbrt::Space::Exporter.export(@client, ) Lbrt::Space::DSL.convert(exported, ) end |
#list ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lbrt/space.rb', line 10 def list json = {} space_by_name_or_id = build_space_by_name_or_id space_by_name_or_id.each do |name_or_id, space_id| json[space_id] = { name: name_or_id, url: space_url(space_id), } end puts JSON.pretty_generate(json) end |
#peco ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/lbrt/space.rb', line 24 def peco space_by_name_or_id = build_space_by_name_or_id result = PecoSelector.select_from(space_by_name_or_id) result.each do |space_id| url = space_url(space_id) Lbrt::Utils.open(url) end end |