Class: Tagfish::Tags
- Inherits:
-
Object
- Object
- Tagfish::Tags
- Defined in:
- lib/tagfish/tags.rb
Instance Attribute Summary collapse
-
#tag_map ⇒ Object
readonly
Returns the value of attribute tag_map.
Instance Method Summary collapse
-
#initialize(tag_map) ⇒ Tags
constructor
A new instance of Tags.
- #latest_tag ⇒ Object
- #tag_names ⇒ Object
Constructor Details
#initialize(tag_map) ⇒ Tags
Returns a new instance of Tags.
9 10 11 |
# File 'lib/tagfish/tags.rb', line 9 def initialize(tag_map) @tag_map = tag_map end |
Instance Attribute Details
#tag_map ⇒ Object (readonly)
Returns the value of attribute tag_map.
7 8 9 |
# File 'lib/tagfish/tags.rb', line 7 def tag_map @tag_map end |
Instance Method Details
#latest_tag ⇒ Object
17 18 19 20 21 |
# File 'lib/tagfish/tags.rb', line 17 def latest_tag tag_names.detect do |tag_name| (tag_map[tag_name] == tag_map["latest"]) && (tag_name != "latest") end end |
#tag_names ⇒ Object
13 14 15 |
# File 'lib/tagfish/tags.rb', line 13 def tag_names tag_map.keys.sort end |