Class: Range

Inherits:
Object show all
Defined in:
lib/core_ex.rb,
lib/core_ex/yaml.rb

Overview

FIXME

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.yaml_new(klass, tag, val) ⇒ Object



126
127
128
129
130
131
132
133
134
# File 'lib/core_ex/yaml.rb', line 126

def yaml_new( klass, tag, val )
  begin
    yaml_new_no_eval klass, tag, val
  rescue YAML::TypeError
    range = eval val.to_s
    raise unless range.is_a? Range
    range
  end
end

.yaml_new_no_evalObject



125
# File 'lib/core_ex/yaml.rb', line 125

alias_method :yaml_new_no_eval, :yaml_new

Instance Method Details

#sizeObject



345
346
347
# File 'lib/core_ex.rb', line 345

def size
 (max.to_i - min.to_i).abs
end