File: nil_class.rb

package info (click to toggle)
ruby-origin 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 248 kB
  • sloc: ruby: 1,196; makefile: 3
file content (82 lines) | stat: -rw-r--r-- 2,064 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# encoding: utf-8
module Origin
  module Extensions

    # This module contains additional nil behaviour.
    module NilClass

      # Add this object to nil.
      #
      # @example Add the object to a nil value.
      #   nil.__add__([ 1, 2, 3 ])
      #
      # @param [ Object ] object The object to add.
      #
      # @return [ Object ] The provided object.
      #
      # @since 1.0.0
      def __add__(object); object; end

      # Add this object to nil.
      #
      # @example Add the object to a nil value.
      #   nil.__expanded__([ 1, 2, 3 ])
      #
      # @param [ Object ] object The object to expanded.
      #
      # @return [ Object ] The provided object.
      #
      # @since 1.0.0
      def __expanded__(object); object; end

      # Evolve the nil into a date or time.
      #
      # @example Evolve the nil.
      #   nil.__evolve_time__
      #
      # @return [ nil ] nil.
      #
      # @since 1.0.0
      def __evolve_time__; self; end
      alias :__evolve_date__ :__evolve_time__

      # Add this object to nil.
      #
      # @example Add the object to a nil value.
      #   nil.__intersect__([ 1, 2, 3 ])
      #
      # @param [ Object ] object The object to intersect.
      #
      # @return [ Object ] The provided object.
      #
      # @since 1.0.0
      def __intersect__(object); object; end

      # Add this object to nil.
      #
      # @example Add the object to a nil value.
      #   nil.__override__([ 1, 2, 3 ])
      #
      # @param [ Object ] object The object to override.
      #
      # @return [ Object ] The provided object.
      #
      # @since 1.0.0
      def __override__(object); object; end

      # Add this object to nil.
      #
      # @example Add the object to a nil value.
      #   nil.__union__([ 1, 2, 3 ])
      #
      # @param [ Object ] object The object to union.
      #
      # @return [ Object ] The provided object.
      #
      # @since 1.0.0
      def __union__(object); object; end
    end
  end
end

::NilClass.__send__(:include, Origin::Extensions::NilClass)