Sha256: 2dbbb2edffdb6efb52a11dd8c7814153b57c9d443a6faae0efc4671232527c2d

Contents?: true

Size: 515 Bytes

Versions: 6

Compression:

Stored size: 515 Bytes

Contents

module Seam
  class Step
    attr_accessor :name
    attr_accessor :type
    attr_accessor :arguments

    def initialize(args = {})
      args.each { |k, v| self.send "#{k}=".to_sym, v }
    end

    def to_hash
      {
        name:      name,
        type:      type,
        arguments: get_arguments
      }
    end

    private

    def get_arguments
      arguments.map do |x|
        if x.is_a? Hash
          HashWithIndifferentAccess.new(x)
        else
          x
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
seam-0.0.17 lib/seam/step.rb
seam-0.0.16 lib/seam/step.rb
seam-0.0.15 lib/seam/step.rb
seam-0.0.14 lib/seam/step.rb
seam-0.0.13 lib/seam/step.rb
seam-0.0.12 lib/seam/step.rb