Class: CSKit::Parsers::Bible::Verse

Inherits:
Struct
  • Object
show all
Defined in:
lib/cskit/parsers/bible/bible_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#finishObject

Returns the value of attribute finish

Returns:

  • (Object)

    the current value of finish



35
36
37
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 35

def finish
  @finish
end

#startObject

Returns the value of attribute start

Returns:

  • (Object)

    the current value of start



35
36
37
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 35

def start
  @start
end

#starterObject

Returns the value of attribute starter

Returns:

  • (Object)

    the current value of starter



35
36
37
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 35

def starter
  @starter
end

#terminatorObject

Returns the value of attribute terminator

Returns:

  • (Object)

    the current value of terminator



35
36
37
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 35

def terminator
  @terminator
end

Instance Method Details

#to_hashObject



48
49
50
51
52
53
54
55
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 48

def to_hash
  {
    start: start,
    finish: finish,
    starter: starter ? starter.to_hash : nil,
    terminator: terminator ? terminator.to_hash : nil
  }
end

#to_sObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 36

def to_s
  str = if start == finish
    start.to_s
  else
    "#{start}-#{finish}"
  end

  str << " #{starter}" if starter
  str << " (to #{terminator})" if terminator
  str
end