examples/tree.rb in storyblok-3.0.1 vs examples/tree.rb in storyblok-3.1.0
- old
+ new
@@ -1,30 +1,30 @@
# bundle exec ruby examples/tree.rb
-require 'storyblok'
+require "storyblok"
logger = Logger.new(STDOUT)
client = Storyblok::Client.new(
- token: 't618GfLe1YHICBioAHnMrwtt',
- api_url: 'localhost:3001',
+ token: "t618GfLe1YHICBioAHnMrwtt",
+ api_url: "localhost:3001",
secure: false,
logger: logger
)
tree = client.tree
-puts '<ul>'
+puts "<ul>"
tree.each do |key, item|
- puts '<li>' + item['item']['name']
+ puts "<li>" + item["item"]["name"]
- if !item['children'].empty?
- puts '<ul>'
- item['children'].each do |key, inner_item|
- puts '<li>' + inner_item['item']['name'] + '</li>'
+ if !item["children"].empty?
+ puts "<ul>"
+ item["children"].each do |key, inner_item|
+ puts "<li>" + inner_item["item"]["name"] + "</li>"
end
- puts '</ul>'
+ puts "</ul>"
end
- puts '</li>'
+ puts "</li>"
end
-puts '</ul>'
+puts "</ul>"