Class: Qti::V1::Models::Choices::LogicalIdentifierChoice

Inherits:
Base show all
Defined in:
lib/qti/v1/models/choices/logical_identifier_choice.rb

Constant Summary

Constants inherited from Models::Base

Models::Base::ELEMENTS_REMAP

Instance Attribute Summary

Attributes inherited from Models::Base

#doc

Instance Method Summary collapse

Methods inherited from Base

#qti_version

Methods inherited from Models::Base

#css_with_single_check, from_path!, #parse_xml, #remap_href_path, #remap_unknown_tags_transformer, #sanitize_config, #sanitize_content!, #xpath_with_single_check

Constructor Details

#initialize(node) ⇒ LogicalIdentifierChoice

Returns a new instance of LogicalIdentifierChoice.



8
9
10
# File 'lib/qti/v1/models/choices/logical_identifier_choice.rb', line 8

def initialize(node)
  @node = node
end

Instance Method Details

#identifierObject



12
13
14
# File 'lib/qti/v1/models/choices/logical_identifier_choice.rb', line 12

def identifier
  @identifier ||= @node.attributes['ident'].value
end

#item_bodyObject



16
17
18
19
20
21
# File 'lib/qti/v1/models/choices/logical_identifier_choice.rb', line 16

def item_body
  @item_body ||= begin
    node = @node.dup
    node.content.strip.gsub(/\s+/, ' ')
  end
end