Method: Emojidex::Data::Collection#category

Defined in:
lib/emojidex/data/collection.rb

#category(category_code) ⇒ Object

Get all emoji from this collection that are part of the specified category Returns a new collection of only emoji in the specified category



114
115
116
117
# File 'lib/emojidex/data/collection.rb', line 114

def category(category_code)
  categorized = @emoji.values.select { |moji| moji.category == category_code }
  Emojidex::Data::Collection.new(emoji: categorized, r18: @r18)
end