Sha256: f98e278bd33d8ac77abbb3ec4896be4c7aa19adf3078b62413813d3fe2344f68

Contents?: true

Size: 454 Bytes

Versions: 1

Compression:

Stored size: 454 Bytes

Contents

class Muddyit::Entity < Muddyit::Generic

  def classification
    unless @attributes[:type]
      # We merge here as we don't want to overwrite a entity specific confidence score
      @attributes.merge!(self.fetch)
    end
    @attributes[:type]
  end

  protected
  def fetch
    api_url = "/entities/#{URI.escape(CGI.escape(@attributes[:uri]),'.')}"
    response = @muddyit.send_request(api_url, :get)
    response.nested_symbolize_keys!
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
monkeyhelper-muddyit_fu-0.1.1 lib/muddyit/entity.rb