lib/ringcentral_sdk/rest/messages_retriever.rb
Method has too many lines. [20/15] Open
Open
def retrieve_for_event(event, params = {})
unless event.is_a? RingCentralSdk::REST::Event
raise ArgumentError, 'retrieve_for_event requires RingCentralSdk::REST::Event argument'
end
url = event.doc.getAttr :event
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Prefer Date or Time over DateTime. Open
Open
last_updated_dt = DateTime.iso8601(last_updated_s)
- Read upRead up
- Exclude checks
This cop checks for uses of DateTime
that should be replaced by
Date
or Time
.
Example:
# bad - uses `DateTime` for current time
DateTime.now
# good - uses `Time` for current time
Time.now
# bad - uses `DateTime` for modern date
DateTime.iso8601('2016-06-29')
# good - uses `Date` for modern date
Date.iso8601('2016-06-29')
# good - uses `DateTime` with start argument for historical date
DateTime.iso8601('1751-04-23', Date::ENGLAND)
Prefer Date or Time over DateTime. Open
Open
rec_last_modified_time_dt = DateTime.iso8601(rec_last_modified_time)
- Read upRead up
- Exclude checks
This cop checks for uses of DateTime
that should be replaced by
Date
or Time
.
Example:
# bad - uses `DateTime` for current time
DateTime.now
# good - uses `Time` for current time
Time.now
# bad - uses `DateTime` for modern date
DateTime.iso8601('2016-06-29')
# good - uses `Date` for modern date
Date.iso8601('2016-06-29')
# good - uses `DateTime` with start argument for historical date
DateTime.iso8601('1751-04-23', Date::ENGLAND)