Method: Intro::Tour#format_attributes

Defined in:
app/models/intro/tour.rb

#format_attributesObject



74
75
76
77
78
79
80
81
82
# File 'app/models/intro/tour.rb', line 74

def format_attributes
  i[ident controller_path action_name].each do |attribute|
    strip_attribute = send(attribute).try(:strip)
    send("#{attribute}=", strip_attribute)
  end

  self.options = JSON.parse(options) rescue {} unless options.is_a?(Hash)
  self.route   = JSON.parse(route) rescue {} unless route.is_a?(Hash)
end