Class: WebpageUpdateChecker::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/webpage_update_checker/client.rb

Instance Method Summary collapse

Instance Method Details

#current_comparison_value(checked_object) ⇒ Object



15
16
17
# File 'lib/webpage_update_checker/client.rb', line 15

def current_comparison_value(checked_object)
  checked_object.current_comparison_value
end

#current_diff_value(checked_object) ⇒ Object

Depricated method



20
21
22
# File 'lib/webpage_update_checker/client.rb', line 20

def current_diff_value(checked_object)
  current_comparison_value(checked_object)
end

#updated?(checked_object, previous_comparison_value: nil, previous_diff_value: nil) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
# File 'lib/webpage_update_checker/client.rb', line 6

def updated?(checked_object, previous_comparison_value: nil, previous_diff_value: nil)
  if previous_comparison_value.nil?
    # Deprecated keyword argument
    current_comparison_value(checked_object) != previous_diff_value
  else
    current_comparison_value(checked_object) != previous_comparison_value
  end
end