Class: HardCiter::IntextMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/hardciter/intext_match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(position = nil, regex_match = nil, type = nil) ⇒ IntextMatch

Returns a new instance of IntextMatch.



8
9
10
11
12
# File 'lib/hardciter/intext_match.rb', line 8

def initialize(position=nil, regex_match=nil, type=nil)
  @position = position
  @regex_match = regex_match
  @type = type
end

Instance Attribute Details

#citationObject

Returns the value of attribute citation.



6
7
8
# File 'lib/hardciter/intext_match.rb', line 6

def citation
  @citation
end

#next_in_groupObject

Returns the value of attribute next_in_group.



6
7
8
# File 'lib/hardciter/intext_match.rb', line 6

def next_in_group
  @next_in_group
end

#positionObject

Returns the value of attribute position.



6
7
8
# File 'lib/hardciter/intext_match.rb', line 6

def position
  @position
end

#regex_matchObject

Returns the value of attribute regex_match.



6
7
8
# File 'lib/hardciter/intext_match.rb', line 6

def regex_match
  @regex_match
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/hardciter/intext_match.rb', line 6

def type
  @type
end

Instance Method Details

#cite_keyObject



14
15
16
17
# File 'lib/hardciter/intext_match.rb', line 14

def cite_key
  match_data = HardCiter.configuration.cite_key_pattern.match(@regex_match)
  match_data[0] if match_data.is_a? MatchData
end