Module: DoverToCalais

Defined in:
lib/dover_to_calais.rb,
lib/dover_to_calais/models.rb,
lib/dover_to_calais/version.rb

Defined Under Namespace

Classes: Dover, EntityModel, ResponseData, ResponseItem

Constant Summary collapse

PROXY =
nil
REDIS =
"redis://127.0.0.1:6379/6"
VERSION =
"0.2.1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#countInteger (readonly)

Returns the count (frequency) of the element in the given input.

Returns:

  • (Integer)

    the count (frequency) of the element in the given input.



# File 'lib/dover_to_calais.rb', line 28

#importance1, 2 (readonly)

Only applicable to the SocialTag element.

Returns:

  • (1, 2)

    the importance of the SocialTag.



# File 'lib/dover_to_calais.rb', line 28

#nameString (readonly)

Returns the element’s name.

Returns:

  • (String)

    the element’s name.



# File 'lib/dover_to_calais.rb', line 28

#normalizedString (readonly)

If the element is one of: (Company, City, ProvinceOrState, Country) OpenCalais provides disambiguation of its value in the ‘normalized’ attribute. For instance, the element <City>Birmingham</City> may include the attribute normalized = “Birmingham, UK” in order to avoid confusion with the city of Birmingham, USA.

Returns:

  • (String)

    the element text’s disambiguated value



# File 'lib/dover_to_calais.rb', line 28

#originalValueString (readonly)

Only applicable to the SocialTag element.

Returns:

  • (String)

    The original value of the SocialTag.



# File 'lib/dover_to_calais.rb', line 28

#relevanceFloat (readonly)

The importance of the element in the context of the given input, in the range 0-1 (1 being the most relevant and important). The score has 3-digit precision after the decimal point.

Returns:

  • (Float)

    the element’s relevance, in the range 0-1.



# File 'lib/dover_to_calais.rb', line 28

#valueString (readonly)

Returns the element’s text value.

Returns:

  • (String)

    the element’s text value.



# File 'lib/dover_to_calais.rb', line 28

Class Method Details

.flushdbObject



19
20
21
22
# File 'lib/dover_to_calais.rb', line 19

def self.flushdb
  Ohm.redis = Redic.new(REDIS)
  Ohm.redis.call "FLUSHDB"
end