Class: Obp::Access::Renderer::Elements::BibRef

Inherits:
Object
  • Object
show all
Defined in:
lib/obp/access/elements/bibliography/bib_ref.rb

Constant Summary collapse

REF_PATTERN =
/\A\[(\d+)\]\s*/
DATED_PATTERN =
/:\d{4}/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(td_node, anchor_node) ⇒ BibRef

Returns a new instance of BibRef.



13
14
15
16
17
18
19
# File 'lib/obp/access/elements/bibliography/bib_ref.rb', line 13

def initialize(td_node, anchor_node)
  text = td_node.text
  @index = parse_index(text)
  @std_id = parse_std_id(anchor_node)
  @type = infer_type(text)
  @std_ref_text, @title_text = parse_parts(td_node)
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



11
12
13
# File 'lib/obp/access/elements/bibliography/bib_ref.rb', line 11

def index
  @index
end

#std_idObject (readonly)

Returns the value of attribute std_id.



11
12
13
# File 'lib/obp/access/elements/bibliography/bib_ref.rb', line 11

def std_id
  @std_id
end

#std_ref_textObject (readonly)

Returns the value of attribute std_ref_text.



11
12
13
# File 'lib/obp/access/elements/bibliography/bib_ref.rb', line 11

def std_ref_text
  @std_ref_text
end

#title_textObject (readonly)

Returns the value of attribute title_text.



11
12
13
# File 'lib/obp/access/elements/bibliography/bib_ref.rb', line 11

def title_text
  @title_text
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/obp/access/elements/bibliography/bib_ref.rb', line 11

def type
  @type
end