module Convection::Model::Mixin::Taggable

Add tag helpers to taddable resources

Public Instance Methods

immutable_metadata(purpose, target = '') click to toggle source

Helper for Asgard

# File lib/convection/model/mixin/taggable.rb, line 33
def immutable_metadata(purpose, target = '')
  tag('immutable_metadata', JSON.generate(
    :purpose => purpose,
    :target => target
  ))
end
render_tags(resource) click to toggle source
# File lib/convection/model/mixin/taggable.rb, line 40
def render_tags(resource)
  resource.tap do |r|
    r['Properties']['Tags'] = tags.render unless tags.empty?
  end
end
tag(key, value) click to toggle source
# File lib/convection/model/mixin/taggable.rb, line 28
def tag(key, value)
  tags[key] = value
end
tags() click to toggle source
# File lib/convection/model/mixin/taggable.rb, line 24
def tags
  @tags ||= Tags.new
end