Skip to content
New issue

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

Sketchup::OptionsProvider#each has broken code example #223

Closed
DanRathbun opened this issue Mar 12, 2019 · 0 comments
Closed

Sketchup::OptionsProvider#each has broken code example #223

DanRathbun opened this issue Mar 12, 2019 · 0 comments

Comments

@DanRathbun
Copy link

SketchUp Ruby API Issue - Documentation

Sketchup::OptionsProvider#each has broken code example.

The example ...

model = Sketchup.active_model.options
provider = model.options['UnitsOptions']
provider.each { |key, value| puts "#{key} = #{value}" }

... results in the NoMethodError message ...
Error: #<NoMethodError: undefined method `options' for #<Sketchup::OptionsManager:0x000279ae2fac90>>

The easiest fix is to correct the first line to ...

model = Sketchup.active_model

I believe that the intended example was meant to be ...

manager = Sketchup.active_model.options
provider = manager['UnitsOptions']
provider.each { |key, value| puts "#{key} = #{value}" }

... but someone didn't actually run the example. (tsk... tsk)

~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants