machine_tag 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -0
- data/lib/machine_tag/set.rb +7 -5
- data/lib/machine_tag/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -74,6 +74,7 @@ tags.machine_tags # => #<Set: {"geo:lat=34.4348067", "geo:lon=-119.801
|
|
74
74
|
tags['geo'] # => #<Set: {"geo:lat=34.4348067", "geo:lon=-119.8016962"}>
|
75
75
|
tags['geo:lat'] # => #<Set: {"geo:lat=34.4348067"}>
|
76
76
|
tags['geo', 'lon'] # => #<Set: {"geo:lon=-119.8016962"}>
|
77
|
+
tags[/^geo:(lat|lon)$/] # => #<Set: {"geo:lat=34.4348067", "geo:lon=-119.8016962"}>
|
77
78
|
```
|
78
79
|
|
79
80
|
More information can be found in the [documentation].
|
data/lib/machine_tag/set.rb
CHANGED
@@ -81,13 +81,15 @@ module MachineTag
|
|
81
81
|
#
|
82
82
|
# @example
|
83
83
|
# tags = MachineTag::Set['a:b=x', 'a:b=y', 'a:c=z']
|
84
|
-
# tags['a']
|
85
|
-
# tags['a', 'b']
|
86
|
-
# tags['a:c']
|
84
|
+
# tags['a'] # => #<Set: {"a:b=x", "a:b=y", "a:c=z"}>
|
85
|
+
# tags['a', 'b'] # => #<Set: {"a:b=x", "a:b=y"}>
|
86
|
+
# tags['a:c'] # => #<Set: {"a:c=z"}>
|
87
|
+
# tags['a', /^[bc]$/] # => #<Set: {"a:b=x", "a:b=y", "a:c=z"}>
|
88
|
+
# tags[/^a:[bc]$/] # => #<Set: {"a:b=x", "a:b=y", "a:c=z"}>
|
87
89
|
#
|
88
|
-
# @param namespace_or_namespace_and_predicate [String] the namespace to retrieve or the namespace
|
90
|
+
# @param namespace_or_namespace_and_predicate [String, Regexp] the namespace to retrieve or the namespace
|
89
91
|
# and predicate to retreive combined in a string separated by +':'+
|
90
|
-
# @param predicate [String, nil] the predicate to retreive
|
92
|
+
# @param predicate [String, Regexp, nil] the predicate to retreive
|
91
93
|
#
|
92
94
|
# @return [::Set<Tag>] the machines tags that have the given namespace or namespace and predicate
|
93
95
|
#
|
data/lib/machine_tag/version.rb
CHANGED