Module: Version::File::PlainFormat

Extended by:
PlainFormat
Included in:
PlainFormat
Defined in:
lib/versus/file/plain_format.rb

Overview

Plain style version file, e.g.

1.2.0

Instance Method Summary collapse

Instance Method Details

#match?(data) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
# File 'lib/versus/file/plain_format.rb', line 15

def match?(data)
  return false unless String === data
  # TODO: re-match here
  return true
end

#parse(string) ⇒ Object



31
32
33
# File 'lib/versus/file/plain_format.rb', line 31

def parse(string)
  Number.parse(string.strip)
end

#render(number) ⇒ Object



24
25
26
# File 'lib/versus/file/plain_format.rb', line 24

def render(number)
  number.to_s
end