Skip to content

Commit

Permalink
Merge pull request #2 from Rakefire/master
Browse files Browse the repository at this point in the history
Remove unicode characters from name string
  • Loading branch information
nbudin authored Sep 30, 2019
2 parents c08521f + 63f3663 commit 3c44068
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/ntee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

module NTEE
class Category
attr_accessor :name, :code, :subcategories, :parent
attr_accessor :code, :subcategories, :parent
attr_writer :name

def initialize
self.subcategories ||= {}
end

def name
# strip non-ascii characters
@name.gsub(/[\u0080-\u00ff]/, "")
end

def to_s
"#{name} (#{code})"
end
Expand Down

0 comments on commit 3c44068

Please sign in to comment.