Class: Range
Class Method Summary (collapse)
Instance Method Summary (collapse)
Class Method Details
+ (Object) yaml_new(attrs)
186 187 188 |
# File 'lib/yaml/rubytypes.rb', line 186 def Range.yaml_new(attrs) Range.new(attrs['begin'], attrs['end'], attrs['excl']) end |
Instance Method Details
- (Object) pretty_print(q)
390 391 392 393 394 395 396 |
# File 'lib/pp.rb', line 390 def pretty_print(q) q.pp self.begin q.breakable '' q.text(self.exclude_end? ? '...' : '..') q.breakable '' q.pp self.end end |
- (Object) to_yaml(output = nil)
190 191 192 193 194 195 196 197 198 |
# File 'lib/yaml/rubytypes.rb', line 190 def to_yaml(output = nil) YAML::quick_emit(output) do |out| out.map(taguri, to_yaml_style) do |map| map.add('begin', self.begin) map.add('end', self.end) map.add('excl', self.exclude_end?) end end end |