Sha256: 64d06e6e52e6bfbe42136064d508e458e389e8a76bcd723f9b16543a1c04935d

Contents?: true

Size: 577 Bytes

Versions: 15

Compression:

Stored size: 577 Bytes

Contents

#
# option.rb
# Crowdskout
#
# Copyright (c) 2016 Kyle Schutt. All rights reserved.

module Crowdskout
  module Components
    class Option < Component
      attr_accessor :id, :value

      # Factory method to create an Option object from a json string
      # @param [Hash] props - properties to create object from
      # @return [Option]
      def self.create(props)
        obj = Option.new
        if props
          props.each do |key, value|
            obj.send("#{key}=", value) if obj.respond_to? key
          end
        end
        obj
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
crowdskout-0.1.5 lib/crowdskout/components/attributes/option.rb
crowdskout-0.1.4 lib/crowdskout/components/attributes/option.rb
crowdskout-0.1.3 lib/crowdskout/components/attributes/option.rb
crowdskout-0.1.2 lib/crowdskout/components/attributes/option.rb
crowdskout-0.1.1 lib/crowdskout/components/attributes/option.rb
crowdskout-0.1.0 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.20 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.19 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.13 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.10 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.9 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.8 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.7 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.6 lib/crowdskout/components/attributes/option.rb
crowdskout-0.0.5 lib/crowdskout/components/attributes/option.rb