diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-10-01 15:33:55 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-10-01 15:33:55 -0400 |
commit | 7d4665f60be31a0481416cfc152bac4442cc6e74 (patch) | |
tree | 295a7c81ace0792ab5a32427cdbb9c6b8e1a6184 /lib/sisu/v3/epub_format.rb | |
parent | v3: vim, ftplugin/sisu.vim (diff) |
v3: cosmetic code, true ? x : y
Diffstat (limited to 'lib/sisu/v3/epub_format.rb')
-rw-r--r-- | lib/sisu/v3/epub_format.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index c08ae492..06a6d623 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -1740,9 +1740,9 @@ WOK end end def links_guide_open(type='horizontal') - if type=='vertical'; links_guide_vertical_open - else links_guide_horizontal_open - end + (type=='vertical') \ + ? links_guide_vertical_open + : links_guide_horizontal_open end def prefix_a end @@ -1853,12 +1853,12 @@ WOK if @format and not @format.empty? if @format=~/^\d:(\S+)/ #need more reliable marker #if @format =~ /#{Rx[:lv]}/ headname=$1 #format[/\d~(\S+)/m,1] - @headname=if headname =~/^[a-zA-Z]/; %{<id="#{headname}">} #consider: h_#{headname} - else %{<id="h#{headname}"></a>} - end - @headname=if headname =~/^[a-zA-Z]/; %{<a name="#{headname}" id="#{headname}"></a>} #consider: h_#{headname} - else %{<a name="h#{headname}" id="h#{headname}"></a>} - end + @headname=(headname =~/^[a-zA-Z]/) \ + ? %{<id="#{headname}">} + : %{<id="h#{headname}"></a>} + @headname=(headname =~/^[a-zA-Z]/) \ + ? %{<a name="#{headname}" id="#{headname}"></a>} + : %{<a name="h#{headname}" id="h#{headname}"></a>} end end elsif t_o.class.inspect =~/Object/ |