Sha256: ef82a415f388c222a672366ba257344e1ffba50deb0878a638ade5807b05ad22

Contents?: true

Size: 639 Bytes

Versions: 9

Compression:

Stored size: 639 Bytes

Contents

module Conjur::DSL2::Executor
  class Update < Base
    include Annotate
    
    def execute
      statement.record.custom_attribute_names.each do |attr|
        value = statement.record.send(attr)
        action({ 
          'method' => 'put',
          'path' => update_path,
          'parameters' => { attr.to_s => value }
        })
      end
      
      annotate
    end

    def kind_path
      statement.record.resource_kind.pluralize
    end
    
    def update_path
      require 'cgi'
      [ kind_path, CGI.escape(statement.record.id) ].join('/')
    end
    
    def annotate_record
      statement.record
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
conjur-asset-dsl2-0.6.1 lib/conjur/dsl2/executor/update.rb
conjur-asset-dsl2-0.6.0 lib/conjur/dsl2/executor/update.rb
conjur-asset-dsl2-0.5.0 lib/conjur/dsl2/executor/update.rb
conjur-asset-dsl2-0.4.4 lib/conjur/dsl2/executor/update.rb
conjur-asset-dsl2-0.4.3 lib/conjur/dsl2/executor/update.rb
conjur-asset-dsl2-0.4.2 lib/conjur/dsl2/executor/update.rb
conjur-asset-dsl2-0.3.2 lib/conjur/dsl2/executor/update.rb
conjur-asset-dsl2-0.3.1 lib/conjur/dsl2/executor/update.rb
conjur-asset-dsl2-0.3.0 lib/conjur/dsl2/executor/update.rb