Sha256: 2bf56022a09aec0475971eba07ddce0ff75909698564da43eb31de6e2c42d32a

Contents?: true

Size: 426 Bytes

Versions: 1

Compression:

Stored size: 426 Bytes

Contents

module Convection
  module Model
    module Mixin
      ##
      # Add condition helpers
      ##
      module Conditional
        def condition(setter = nil)
          @condition = setter unless setter.nil?
          @condition
        end

        def render_condition(resource)
          resource.tap do |r|
            r['Condition'] = condition unless condition.nil?
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
convection-0.0.1 lib/convection/model/mixin/conditional.rb