Sha256: 10eee27d00d5cce8c6ef2f409f3b34454f359bc50339128665795f1e8f00b4d4
Contents?: true
Size: 795 Bytes
Versions: 7
Compression:
Stored size: 795 Bytes
Contents
# # value.rb # Crowdskout # # Copyright (c) 2016 Kyle Schutt. All rights reserved. module Crowdskout module Components class Value < Component attr_accessor :id, :value # Factory method to create an Value object from a json string # @param [Hash] props - properties to create object from # @return [Value] def self.create(props) obj = Value.new if props props.each do |key, value| if obj.respond_to? key obj.send("#{key}=", value) else # this will create the attribute if it doesn't exist obj.class.send(:attr_accessor, key) obj.instance_variable_set("@#{key}", value) end end end obj end end end end
Version data entries
7 entries across 7 versions & 1 rubygems