lib/tomograph/tomogram.rb in tomograph-0.2.1 vs lib/tomograph/tomogram.rb in tomograph-0.3.0
- old
+ new
@@ -2,16 +2,19 @@
module Tomograph
class Tomogram < String
class << self
def json
- single_sharp = find_resource
+ single_sharps = find_resource
- result = single_sharp['content'].inject([]) do |result, resource|
- next result if text_node?(resource)
+ result = []
+ single_sharps.map do |single_sharp|
+ result += single_sharp['content'].inject([]) do |result, resource|
+ next result if text_node?(resource)
- result.concat(extract_actions(resource))
+ result.concat(extract_actions(resource))
+ end
end
MultiJson.dump(result)
end
def delete_query_and_last_slash(path)
@@ -51,10 +54,10 @@
}
end
end
def find_resource
- documentation['content'][0]['content'].find do |resource|
+ documentation['content'][0]['content'].find_all do |resource|
!text_node?(resource) &&
resource['meta']['classes'][0] == 'resourceGroup' # skip Data Structures
end
end