lib/ribimaybe.rb in ribimaybe-0.0.8 vs lib/ribimaybe.rb in ribimaybe-0.0.9
- old
+ new
@@ -11,10 +11,12 @@
#
def self.to_s
"Nothing"
end
+ alias_method :inspect, :to_s
+
# No operation. Always returns the default value.
#
Contract Any, Proc => Any
def self.maybe(default, &_)
default
@@ -47,12 +49,16 @@
def initialize(value)
@value = value
end
+ # Just string representation.
+ #
def to_s
"Just(#{@value.inspect})"
end
+
+ alias_method :inspect, :to_s
# Compares a Just to another Maybe.
#
# ==== Attributes
#