-
Notifications
You must be signed in to change notification settings - Fork 681
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
add tag object #1590
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
lib/inspec/objects/tag.rb
Outdated
end | ||
|
||
def to_s | ||
"Tag #{@key} with #{@value}" |
There was a problem hiding this comment.
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 <[email protected]>
Signed-off-by: Christoph Hartmann <[email protected]>
71bfc5b
to
8798d0f
Compare
This PR adds tag support to InSpec objects.