Remove "try", because it is a rails feature
Also "&." is only available on ruby >= 2.3 (can be used later)
This commit is contained in:
parent
4ff91a56cc
commit
1f3293a403
3 changed files with 5 additions and 2 deletions
|
|
@ -190,6 +190,8 @@ Style/NumericPredicate:
|
|||
# only with ruby >= 2.3
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
Style/SafeNavigation:
|
||||
Enabled: false
|
||||
|
||||
# only with ruby >= 2.4
|
||||
Performance/RegexpMatch:
|
||||
|
|
|
|||
|
|
@ -269,7 +269,8 @@ module DiasporaFederation
|
|||
end
|
||||
|
||||
private_class_method def self.content_from_doc(doc, content_selector)
|
||||
element_from_doc(doc, content_selector).try(:content)
|
||||
element = element_from_doc(doc, content_selector)
|
||||
element.content if element
|
||||
end
|
||||
|
||||
private_class_method def self.photo_from_doc(doc, photo_selector)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ module DiasporaFederation
|
|||
# @param [Hash] additional_xml_elements additional xml elements
|
||||
# @see DiasporaFederation::Entity#initialize
|
||||
def initialize(data, xml_order=nil, additional_xml_elements={})
|
||||
@xml_order = xml_order.try(:reject) {|name| name =~ /signature/ }
|
||||
@xml_order = xml_order.reject {|name| name =~ /signature/ } if xml_order
|
||||
@additional_xml_elements = additional_xml_elements
|
||||
|
||||
super(data)
|
||||
|
|
|
|||
Loading…
Reference in a new issue