Class: Tagfish::Tags

Inherits:
Object
  • Object
show all
Defined in:
lib/tagfish/tags.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_mapObject (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_tagObject



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_namesObject



13
14
15
# File 'lib/tagfish/tags.rb', line 13

def tag_names
  tag_map.keys.sort
end