module ExpertSenderApi::Serializeable

Private Instance Methods

attributes() click to toggle source
# File lib/expertsender_api/concerns/serializeable.rb, line 6
def attributes
  variables_to_serialize.map do |ivar|
    { name: camel_case(ivar.to_s[1..-1]), value: instance_variable_get(ivar) }
  end
end
camel_case(str) click to toggle source
# File lib/expertsender_api/concerns/serializeable.rb, line 12
def camel_case(str)
  str.split(/[\W_]/).map {|c| c.capitalize}.join
end
variables_to_serialize() click to toggle source
# File lib/expertsender_api/concerns/serializeable.rb, line 16
def variables_to_serialize
  instance_variables
end