class EnumX::DSL::FlagsSerializer
Public Class Methods
new(enum)
click to toggle source
# File lib/enum_x/dsl.rb, line 372 def initialize(enum) @enum = enum end
Public Instance Methods
dump(list)
click to toggle source
# File lib/enum_x/dsl.rb, line 380 def dump(list) # This is the case for using the values from changes and the list is allready a string list = load(list).values unless list.is_a?(EnumX::ValueList) "|#{list.map(&:to_s).join('|')}|" end
load(text)
click to toggle source
# File lib/enum_x/dsl.rb, line 376 def load(text) EnumX::ValueList.new(@enum, text.to_s.split('|').reject(&:blank?)) end