Skip to content

Commit

Permalink
Favor a normal unless-statement over a modifier clause in a multiline…
Browse files Browse the repository at this point in the history
… statement
  • Loading branch information
sferik committed Dec 6, 2016
1 parent 0c280a7 commit a49f442
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions lib/multi_xml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ def initialize(type)
end
end

REQUIREMENT_MAP = [
['ox', :ox],
['libxml', :libxml],
['nokogiri', :nokogiri],
['rexml/document', :rexml],
['oga', :oga],
].freeze unless defined?(REQUIREMENT_MAP)
unless defined?(REQUIREMENT_MAP)
REQUIREMENT_MAP = [
['ox', :ox],
['libxml', :libxml],
['nokogiri', :nokogiri],
['rexml/document', :rexml],
['oga', :oga],
].freeze
end

CONTENT_ROOT = '__content__'.freeze unless defined?(CONTENT_ROOT)

Expand All @@ -46,19 +48,21 @@ def initialize(type)
}.freeze
end

TYPE_NAMES = {
'Symbol' => 'symbol',
'Integer' => 'integer',
'BigDecimal' => 'decimal',
'Float' => 'float',
'TrueClass' => 'boolean',
'FalseClass' => 'boolean',
'Date' => 'date',
'DateTime' => 'datetime',
'Time' => 'datetime',
'Array' => 'array',
'Hash' => 'hash',
}.freeze unless defined?(TYPE_NAMES)
unless defined?(TYPE_NAMES)
TYPE_NAMES = {
'Symbol' => 'symbol',
'Integer' => 'integer',
'BigDecimal' => 'decimal',
'Float' => 'float',
'TrueClass' => 'boolean',
'FalseClass' => 'boolean',
'Date' => 'date',
'DateTime' => 'datetime',
'Time' => 'datetime',
'Array' => 'array',
'Hash' => 'hash',
}.freeze
end

DISALLOWED_XML_TYPES = %w(symbol yaml).freeze

Expand Down

0 comments on commit a49f442

Please sign in to comment.