Hello world

Ruby code posted by Rinat
created at 30 May 21:19, updated at 09 Jun 06:21

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
class Range
  def to_json(*a)
    {
      'json_class'   => self.class.name,
      'data'         => [ first, last, exclude_end? ]
    }.to_json(*a)
  end

  def self.json_create(o)
    new(*o['data'])
  end
end
222 Bytes in 2 ms with coderay