Class: Inspec::Tag
- Inherits:
-
Object
- Object
- Inspec::Tag
- Defined in:
- lib/inspec/objects/tag.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ Tag
constructor
A new instance of Tag.
- #to_hash ⇒ Object
- #to_ruby ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(key, value) ⇒ Tag
Returns a new instance of Tag.
10 11 12 13 14 15 |
# File 'lib/inspec/objects/tag.rb', line 10 def initialize(key, value) @key = key @value = value Inspec.deprecate(:object_classes, "The Inspec::Tag class is deprecated. Use the Inspec::Object::Tag class from the inspec-objects Ruby library.") end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
8 9 10 |
# File 'lib/inspec/objects/tag.rb', line 8 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/inspec/objects/tag.rb', line 8 def value @value end |
Instance Method Details
#to_hash ⇒ Object
17 18 19 20 21 22 |
# File 'lib/inspec/objects/tag.rb', line 17 def to_hash { name: key, value: value, } end |
#to_ruby ⇒ Object
24 25 26 |
# File 'lib/inspec/objects/tag.rb', line 24 def to_ruby "tag #{key}: #{value.inspect}" end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/inspec/objects/tag.rb', line 28 def to_s "Tag #{key} with #{value}" end |