Sha256: cad4198d104695997635a76ac48e30eccf3e1ead904192327b856173a4dc2760
Contents?: true
Size: 897 Bytes
Versions: 16
Compression:
Stored size: 897 Bytes
Contents
require_relative '../entities/attributes' module Inferno module DSL class SuiteOption ATTRIBUTES = [ :id, :title, :description, :list_options, :value ].freeze include Entities::Attributes def initialize(raw_params) params = raw_params.deep_symbolize_keys bad_params = params.keys - ATTRIBUTES raise Exceptions::UnknownAttributeException.new(bad_params, self.class) if bad_params.present? params .compact .each { |key, value| send("#{key}=", value) } self.id = id.to_sym if id.is_a? String end def ==(other) id == other.id && value == other.value end def to_hash self.class::ATTRIBUTES.each_with_object({}) do |attribute, hash| hash[attribute] = send(attribute) end.compact end end end end
Version data entries
16 entries across 16 versions & 1 rubygems