module Either::ActiveModelHelpers

Public Instance Methods

to_either() click to toggle source
# File lib/either/active_model_helpers.rb, line 5
def to_either
  if self.errors.present?
    Either::Left.new(self.errors)
  else
    Either::Right.new(self)
  end
end