Class: CSKit::Parsers::ScienceHealth::Line

Inherits:
Struct
  • Object
show all
Defined in:
lib/cskit/parsers/science_health/science_health_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



22
23
24
# File 'lib/cskit/parsers/science_health/science_health_parser.rb', line 22

def finish
  @finish
end

#startObject

Returns the value of attribute start

Returns:

  • (Object)

    the current value of start



22
23
24
# File 'lib/cskit/parsers/science_health/science_health_parser.rb', line 22

def start
  @start
end

#starterObject

Returns the value of attribute starter

Returns:

  • (Object)

    the current value of starter



22
23
24
# File 'lib/cskit/parsers/science_health/science_health_parser.rb', line 22

def starter
  @starter
end

#terminatorObject

Returns the value of attribute terminator

Returns:

  • (Object)

    the current value of terminator



22
23
24
# File 'lib/cskit/parsers/science_health/science_health_parser.rb', line 22

def terminator
  @terminator
end

Instance Method Details

#to_hashObject



35
36
37
38
39
40
41
42
# File 'lib/cskit/parsers/science_health/science_health_parser.rb', line 35

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

#to_sObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cskit/parsers/science_health/science_health_parser.rb', line 23

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

  str << ' (only)' if only?
  str << " #{start_fragment}" if start_fragment
  str
end