Class: Sevendigital::LabelDigestor

Inherits:
Digestor
  • Object
show all
Defined in:
lib/sevendigital/digestion_tract/label_digestor.rb

Instance Method Summary collapse

Methods inherited from Digestor

#content_present?, #from_xml_string, #get_optional_attribute, #get_optional_node, #get_optional_value, #get_required_attribute, #get_required_node, #get_required_value, #initialize, #list_from_xml_doc, #list_from_xml_string, #make_sure_eating_nokogiri_node, #nested_list_from_xml_doc, #nested_list_from_xml_string, #paginate_results, #value_present?

Constructor Details

This class inherits a constructor from Sevendigital::Digestor

Instance Method Details

#default_element_nameObject

:nodoc:



6
# File 'lib/sevendigital/digestion_tract/label_digestor.rb', line 6

def default_element_name; :label end

#default_list_element_nameObject



7
# File 'lib/sevendigital/digestion_tract/label_digestor.rb', line 7

def default_list_element_name; :labels end

#from_xml_doc(xml_node) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/sevendigital/digestion_tract/label_digestor.rb', line 9

def from_xml_doc(xml_node)
  make_sure_eating_nokogiri_node(xml_node)

  label = Label.new()

  label.id = get_required_attribute(xml_node, "id").to_i
  label.name = get_required_value(xml_node, "name")

  label
end