summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/rels
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-04-08 11:53:12 +0200
committerGeremia Taglialatela <[email protected]>2023-04-08 11:53:12 +0200
commit55526805cf28cc91a22df5811b26cd23bdefa8d3 (patch)
tree2cbc6403b385078b0ed5e275c49f0c60522bdd16 /lib/axlsx/rels
parentacf00d356494ef504c3de0e4a0db6b25f2bd7636 (diff)
downloadcaxlsx-55526805cf28cc91a22df5811b26cd23bdefa8d3.tar.gz
caxlsx-55526805cf28cc91a22df5811b26cd23bdefa8d3.zip
Fix space-related offenses
- Layout/SpaceAfterComma - Layout/SpaceAroundEqualsInParameterDefault - Layout/SpaceAroundOperators - Layout/SpaceBeforeBlockBraces - Layout/SpaceInsideBlockBraces - Layout/SpaceInsideHashLiteralBraces - Layout/SpaceInsideParens
Diffstat (limited to 'lib/axlsx/rels')
-rw-r--r--lib/axlsx/rels/relationship.rb10
-rw-r--r--lib/axlsx/rels/relationships.rb4
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/axlsx/rels/relationship.rb b/lib/axlsx/rels/relationship.rb
index f1759649..aff9fa55 100644
--- a/lib/axlsx/rels/relationship.rb
+++ b/lib/axlsx/rels/relationship.rb
@@ -81,10 +81,10 @@ module Axlsx
# @param [String] type The type of the relationship
# @param [String] target The target for the relationship
# @option [Symbol] :target_mode only accepts :external.
- def initialize(source_obj, type, target, options={})
+ def initialize(source_obj, type, target, options = {})
@source_obj = source_obj
- self.Target=target
- self.Type=type
+ self.Target = target
+ self.Type = type
self.TargetMode = options[:target_mode] if options[:target_mode]
@Id = (self.class.ids_cache[ids_cache_key] ||= self.class.next_free_id)
end
@@ -101,9 +101,9 @@ module Axlsx
# @param [String] str
# @return [String]
def to_xml_string(str = '')
- h = Axlsx.instance_values_for(self).reject{|k, _| k == "source_obj"}
+ h = Axlsx.instance_values_for(self).reject { |k, _| k == "source_obj" }
str << '<Relationship '
- str << (h.map { |key, value| '' << key.to_s << '="' << Axlsx::coder.encode(value.to_s) << '"'}.join(' '))
+ str << (h.map { |key, value| '' << key.to_s << '="' << Axlsx::coder.encode(value.to_s) << '"' }.join(' '))
str << '/>'
end
diff --git a/lib/axlsx/rels/relationships.rb b/lib/axlsx/rels/relationships.rb
index 8f3b62cc..686059fb 100644
--- a/lib/axlsx/rels/relationships.rb
+++ b/lib/axlsx/rels/relationships.rb
@@ -13,7 +13,7 @@ require 'axlsx/rels/relationship.rb'
# @see Relationship#source_obj
# @return [Relationship]
def for(source_obj)
- find{ |rel| rel.source_obj == source_obj }
+ find { |rel| rel.source_obj == source_obj }
end
# serialize relationships
@@ -22,7 +22,7 @@ require 'axlsx/rels/relationship.rb'
def to_xml_string(str = '')
str << '<?xml version="1.0" encoding="UTF-8"?>'
str << ('<Relationships xmlns="' << RELS_R << '">')
- each{ |rel| rel.to_xml_string(str) }
+ each { |rel| rel.to_xml_string(str) }
str << '</Relationships>'
end
end