We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute_Dictionary
Enumerable#to_h
Hash
Attribute_Dictionary has Enumerable#to_h that makes converting to Hash easy
https://github.com/SketchUp/sketchup-annotations/blob/main/src/su_annotations/annotation_manager.rb
self.load(), at line 20 ...
self.load()
# @param [Sketchup::Page] page # @return [Hash] def self.load(page) return {} if page.nil? dictionary = page.attribute_dictionary(DICTIONARY_NAME, false) return {} if dictionary.nil? annotations = {} dictionary.each { |type, data| annotations[type.to_sym] = data } annotations end
... can be simplified to ...
# @param [Sketchup::Page] page # @return [Hash] def self.load(page) return {} if page.nil? dictionary = page.attribute_dictionary(DICTIONARY_NAME, false) return {} if dictionary.nil? dictionary.to_h { |type, data| [ type.to_sym, data ] } end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Attribute_Dictionary
hasEnumerable#to_h
that makes converting toHash
easyhttps://github.com/SketchUp/sketchup-annotations/blob/main/src/su_annotations/annotation_manager.rb
self.load()
, at line 20 ...... can be simplified to ...
The text was updated successfully, but these errors were encountered: