Module: Centralpos::Utils
- Extended by:
- Utils
- Included in:
- Account, Batch, Transaction, Utils
- Defined in:
- lib/centralpos/utils.rb
Instance Method Summary collapse
Instance Method Details
#ensure_array(stuff) ⇒ Object
12 13 14 |
# File 'lib/centralpos/utils.rb', line 12 def ensure_array(stuff) [stuff].flatten(1) end |
#in_time_zone(datetime) ⇒ Object
16 17 18 19 20 |
# 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 ⇒ Object
5 6 7 8 9 10 |
# 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 |