Custom attribute writer method checking allowed values (enum).
 @param [Object] storage Object to be assigned
190172
def storage=(storage)
      validator = EnumAttributeValidator.new('String', ['cache'])
      unless validator.valid?(storage)
        fail ArgumentError, 'invalid value for "storage", must be one of #{validator.allowable_values}.'
      end
      @storage = storage
    end
902655
def itemization_type=(itemization_type)
      validator = EnumAttributeValidator.new('String', ["ITEM", "CUSTOM_AMOUNT", "GIFT_CARD_ACTIVATION", "GIFT_CARD_RELOAD", "GIFT_CARD_UNKNOWN", "OTHER"])
      unless validator.valid?(itemization_type)
        fail ArgumentError, "invalid value for 'itemization_type', must be one of #{validator.allowable_values}."
      end
      @itemization_type = itemization_type
    end
790389
def visibility=(visibility)
      validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"])
      unless validator.valid?(visibility)
        fail ArgumentError, "invalid value for 'visibility', must be one of #{validator.allowable_values}."
      end
      @visibility = visibility
    end
244761
function enum_ (options) {
  options.hash.kind = 'member'
  options.hash.isEnum = true
  var result = _identifier(options)
  return result ? options.fn(result) : 'ERROR, Cannot find enum.'
}
43468
def eac3_room_type=(eac3_room_type)
      validator = EnumAttributeValidator.new('String', ["m0", "m1", "m2"])
      unless validator.valid?(eac3_room_type)
        fail ArgumentError, "invalid value for 'eac3_room_type', must be one of #{validator.allowable_values}."
      end
      @eac3_room_type = eac3_room_type
    end
983475
def attachment_attributes_valid?
        [:size, :content_type].each do |attr_name|
          enum = attachment_options[attr_name]
          errors.add attr_name, I18n.translate("activerecord.errors.messages.inclusion", attr_name => enum) unless enum.nil? || enum.include?(send(attr_name))
        end
      end
853573
def document_type=(document_type)
      validator = EnumAttributeValidator.new('String', ["pdf", "xls", "xlsx"])
      unless validator.valid?(document_type)
        fail ArgumentError, "invalid value for 'document_type', must be one of #{validator.allowable_values}."
      end
      @document_type = document_type
    end
237495
def []=(name, value)
      @column_keys << name
      @attrs[to_key(name)] = value
      define_accessor(name) unless respond_to?(name)
    end
7924
def valid?
      return false if @status.nil?
      status_validator = EnumAttributeValidator.new('String', ['error'])
      return false unless status_validator.valid?(@status)
      return false if @errors.nil?
      true
    end
418021
def discount_type=(discount_type)
      validator = EnumAttributeValidator.new('String', ["FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
      unless validator.valid?(discount_type)
        fail ArgumentError, "invalid value for 'discount_type', must be one of #{validator.allowable_values}."
      end
      @discount_type = discount_type
    end
489403
def syncing=(syncing)
      validator = EnumAttributeValidator.new('String', ["starting", "already_started"])
      unless validator.valid?(syncing)
        fail ArgumentError, "invalid value for 'syncing', must be one of #{validator.allowable_values}."
      end
      @syncing = syncing
    end
1075001
def override_attributes!(attrs={})
      @column_keys = attrs.keys
      @attrs = HashWithIndifferentAccess.new(Hash[attrs.map { |k, v| [ to_key(k), v ] }])
      @attrs.map { |k, v| define_accessor(k) }
    end
87446
def create_string(value)
      if (values = current_attributes[:values]) &&
        (values = values.sort_by {|e| e.to_s})
          value = auto_alias_value(values, value)
          validate_enum_values(values, value)
      end
      value
    end
272076
def _write_enums(self, entity_name, attributes):
        
        
        self.enum_attrs_for_locale[entity_name] = attributes;

        for attribute in attributes:
            enum_name = "%s%sEnum" % (entity_name, attribute.name[0].upper() + attribute.name[1:])
            self.enum_list.append(enum_name)
            filename = "%s%s.js" % (self._class_prefix, enum_name)
            self.write(destination = self.enum_directory,
                        filename=filename,
                        template_name="enum.js.tpl",
                        class_prefix = self._class_prefix,
                        enum_name = enum_name,
                        allowed_choices = set(attribute.allowed_choices))
1222107
def write_attribute(name, value)
      name = name.to_s

      if respond_to?("#{name}=")
        __send__("attribute=", name, value)
      else
        raise ::ActiveRemote::UnknownAttributeError, "unknown attribute: #{name}"
      end
    end
1189281
def rule=(rule)
      validator = EnumAttributeValidator.new('String', ["INCLUDE", "EXCLUDE"])
      unless validator.valid?(rule)
        fail ArgumentError, "invalid value for 'rule', must be one of #{validator.allowable_values}."
      end
      @rule = rule
    end
796859
def selection_type=(selection_type)
      validator = EnumAttributeValidator.new('String', ["SINGLE", "MULTIPLE"])
      unless validator.valid?(selection_type)
        fail ArgumentError, "invalid value for 'selection_type', must be one of #{validator.allowable_values}."
      end
      @selection_type = selection_type
    end