Sha256: 8d36e5fcd8c219ff381d8a2d107a12d24373755ae3f294698f2696ab211fbb5d

Contents?: true

Size: 528 Bytes

Versions: 20

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true

module Spout
  module Models
    class Option
      attr_accessor :display_name, :value, :description, :missing

      def initialize(option_hash)
        %w(display_name value description missing).each do |method|
          instance_variable_set("@#{method}", (option_hash.is_a?(Hash) ? option_hash : {})[method])
        end
      end

      def deploy_params
        { display_name: display_name, value: value, description: description,
          missing: missing }
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
spout-1.0.0 lib/spout/models/option.rb
spout-1.0.0.beta3 lib/spout/models/option.rb
spout-1.0.0.beta2 lib/spout/models/option.rb
spout-1.0.0.beta1 lib/spout/models/option.rb
spout-0.14.1 lib/spout/models/option.rb
spout-0.14.0 lib/spout/models/option.rb
spout-0.14.0.rc lib/spout/models/option.rb
spout-0.14.0.beta3 lib/spout/models/option.rb
spout-0.14.0.beta2 lib/spout/models/option.rb
spout-0.14.0.beta1 lib/spout/models/option.rb
spout-0.13.0 lib/spout/models/option.rb
spout-0.13.0.beta2 lib/spout/models/option.rb
spout-0.13.0.beta1 lib/spout/models/option.rb
spout-0.12.1 lib/spout/models/option.rb
spout-0.12.0 lib/spout/models/option.rb
spout-0.12.0.rc2 lib/spout/models/option.rb
spout-0.12.0.rc lib/spout/models/option.rb
spout-0.12.0.beta2 lib/spout/models/option.rb
spout-0.12.0.beta1 lib/spout/models/option.rb
spout-0.11.1 lib/spout/models/option.rb