Class: UClassifyClassifier
- Inherits:
-
Object
- Object
- UClassifyClassifier
- Defined in:
- lib/uclassify_classifier.rb
Instance Method Summary collapse
-
#initialize(classifier_name, text) ⇒ UClassifyClassifier
constructor
A new instance of UClassifyClassifier.
- #to_xml_node(xml_document) ⇒ Object
Constructor Details
#initialize(classifier_name, text) ⇒ UClassifyClassifier
Returns a new instance of UClassifyClassifier.
2 3 4 5 |
# File 'lib/uclassify_classifier.rb', line 2 def initialize (classifier_name,text) @classifier_name = classifier_name @text = text end |
Instance Method Details
#to_xml_node(xml_document) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/uclassify_classifier.rb', line 7 def to_xml_node xml_document classifier_node = Nokogiri::XML::Node.new('classify',xml_document) classifier_node['id'] = UClassifyUtils.string_to_id(@classifier_name) classifier_node['classifierName'] = @classifier_name classifier_node['textId'] = UClassifyUtils.string_to_id(@text) classifier_node end |