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

add tag object #1590

Merged
merged 2 commits into from
Mar 22, 2017
Merged

add tag object #1590

merged 2 commits into from
Mar 22, 2017

Conversation

chris-rock
Copy link
Contributor

This PR adds tag support to InSpec objects.

Copy link
Contributor

@adamleff adamleff left a comment

Choose a reason for hiding this comment

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

This looks good. Just one question on the to_hash method of Inspec::Tag.

@value = value
end

def to_hash
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see @name and @opts used here. Should this be @key and @value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is fixed now :-) I also added a test for to_hash

end

def to_s
"Tag #{@key} with #{@value}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a Ruby styling thing, but I try to avoid using instance variables if they're set up as attr_readers or attr_accessors, just for consistency.

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
@adamleff adamleff merged commit 7c11ff9 into master Mar 22, 2017
@adamleff adamleff deleted the chris-rock/tag branch March 22, 2017 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants