summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2015-05-23 14:16:18 -0600
committerDan Allen <dan.j.allen@gmail.com>2015-05-23 14:16:18 -0600
commit2d221cfd0682896d43926aa11d3ff52663ccae44 (patch)
tree1f5671129060f4e61f9c686e608673a8cf03c46d
parentd27e70de908a6d333aaf707da6755680cc33a0ee (diff)
use === instead of .is_a? and remove unnecessary brackets
-rw-r--r--lib/asciidoctor/substitutors.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/asciidoctor/substitutors.rb b/lib/asciidoctor/substitutors.rb
index 5e754fe6..c5b5fddd 100644
--- a/lib/asciidoctor/substitutors.rb
+++ b/lib/asciidoctor/substitutors.rb
@@ -80,7 +80,7 @@ module Substitutors
elsif subs == :normal
subs = SUBS[:normal]
elsif expand
- if subs.is_a? ::Symbol
+ if ::Symbol === subs
subs = COMPOSITE_SUBS[subs] || [subs]
else
effective_subs = []
@@ -98,7 +98,7 @@ module Substitutors
return source if subs.empty?
- text = (multiline = source.is_a? ::Array) ? (source * EOL) : source
+ text = (multiline = ::Array === source) ? source * EOL : source
if (has_passthroughs = subs.include? :macros)
text = extract_passthroughs text
@@ -138,7 +138,7 @@ module Substitutors
#
# returns - A String with normal substitutions performed
def apply_normal_subs(lines)
- apply_subs lines.is_a?(::Array) ? (lines * EOL) : lines
+ apply_subs(::Array === lines ? lines * EOL : lines)
end
# Public: Apply substitutions for titles.
@@ -448,7 +448,7 @@ module Substitutors
return data if data.nil_or_empty?
# normalizes data type to an array (string becomes single-element array)
- if (string_data = String === data)
+ if (string_data = ::String === data)
data = [data]
end
@@ -520,7 +520,7 @@ module Substitutors
result << line unless reject || (reject_if_empty && line.empty?)
end
- string_data ? (result * EOL) : result
+ string_data ? result * EOL : result
end
# Public: Substitute inline macros (e.g., links, images, etc)