module Centralpos::Utils

Public Instance Methods

ensure_array(stuff) click to toggle source
# File lib/centralpos/utils.rb, line 12
def ensure_array(stuff)
  [stuff].flatten(1)
end
in_time_zone(datetime) click to toggle source
# File lib/centralpos/utils.rb, line 16
def in_time_zone(datetime)
  return datetime unless datetime && Centralpos.override_timezone

  datetime.change(offset: Centralpos.default_timezone)
end
inspect() click to toggle source
# File lib/centralpos/utils.rb, line 5
def inspect
  formatted_attrs = attr_inspect.map do |attr|
    "#{attr}: #{send(attr).inspect}"
  end
  "#<#{self.class.name} #{formatted_attrs.join(", ")}>"
end

Private Instance Methods

attr_inspect() click to toggle source
# File lib/centralpos/utils.rb, line 24
def attr_inspect
  []
end