Module: Deli::Param::Offset

Included in:
Adapters::ActiveRecord::Offset, Adapters::Mongoid::Offset, Adapters::Simple::Offset
Defined in:
lib/deli/param.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) parse(value)



127
128
129
130
# File 'lib/deli/param.rb', line 127

def parse(value)
  result = value.to_s.scan(/(\d+)/).flatten[0]
  result.present? ? result.to_i : self.default
end

- (Object) render(value)



132
133
134
# File 'lib/deli/param.rb', line 132

def render(value)
  parse(value)
end