Skip to content

Commit

Permalink
header: added Header#version
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Delugré committed Jan 19, 2019
1 parent 3a918ce commit 975a9a6
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/origami/header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,17 @@ def self.parse(stream) #:nodoc:
end

#
# Outputs self into PDF code.
# Returns the Header version as a String.
#
def to_s(eol: $/)
"%PDF-#{@major_version}.#{@minor_version}".b + eol
end

def to_sym #:nodoc:
"#{@major_version}.#{@minor_version}".to_sym
def version
"#{@major_version}.#{@minor_version}"
end

def to_f #:nodoc:
to_sym.to_s.to_f
#
# Outputs self into PDF code.
#
def to_s(eol: $/)
"%PDF-#{self.version}".b + eol
end
end
end
Expand Down

0 comments on commit 975a9a6

Please sign in to comment.