Class: Range

Inherits:
Object show all
Defined in:
lib/json/add/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.json_create(object) ⇒ Object



93
94
95
# File 'lib/json/add/core.rb', line 93

def self.json_create(object)
  new(*object['a'])
end

Instance Method Details

#to_json(*args) ⇒ Object



97
98
99
100
101
102
# File 'lib/json/add/core.rb', line 97

def to_json(*args)
  {
    JSON.create_id   => self.class.name,
    'a'         => [ first, last, exclude_end? ]
  }.to_json(*args)
end