Class: Isic::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/isic/entity.rb

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Entity

Returns a new instance of Entity.



4
5
6
# File 'lib/isic/entity.rb', line 4

def initialize(code)
  @code = code
end

Instance Method Details

#classify(options = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/isic/entity.rb', line 8

def classify(options = {})
  translation = options[:translation] || :en
  all_codes.inject({}) do |hash, (key, value)|
    hash[key] = Isic::Search.new(value, translation: translation).first
    hash
  end
end