Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Add instance group manager resource to InSpec #68

Merged
merged 1 commit into from
Jan 16, 2019
Merged

Conversation

modular-magician
Copy link
Owner

attr_reader :restarting

def initialize(args = nil)
return if args.nil?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since args is a Hash, you could do all of these assignments as a one-liner if you wanted to.

Something like 'args.each |x| instance_variable_set("@#{x}", args[x])' (pretty sure there's an even cleaner way).

More of a heads-up. I don't have an opinion either way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is possible for these nested objects to contain further nested objects, which require passing args[x] to an initialize method. So I think it's better to keep these similar to the general resource parse method.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call.

@modular-magician modular-magician force-pushed the codegen-pr-1246 branch 3 times, most recently from 9aaa0c9 to 4073a87 Compare January 15, 2019 23:34
@slevenick slevenick merged commit fad1dbf into master Jan 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants