class Grape::Util::Lazy::Object
Attributes
callable[R]
Public Class Methods
new(&callable)
click to toggle source
# File lib/grape/util/lazy/object.rb, line 11 def initialize(&callable) @callable = callable end
Public Instance Methods
!()
click to toggle source
# File lib/grape/util/lazy/object.rb, line 27 def ! !__target_object__ end
!=(other)
click to toggle source
# File lib/grape/util/lazy/object.rb, line 23 def !=(other) __target_object__ != other end
==(other)
click to toggle source
# File lib/grape/util/lazy/object.rb, line 19 def ==(other) __target_object__ == other end
__target_object__()
click to toggle source
# File lib/grape/util/lazy/object.rb, line 15 def __target_object__ @__target_object__ ||= callable.call end
method_missing(method_name, *args, &block)
click to toggle source
Calls superclass method
# File lib/grape/util/lazy/object.rb, line 31 def method_missing(method_name, *args, &block) if __target_object__.respond_to?(method_name) __target_object__.send(method_name, *args, &block) else super end end
respond_to_missing?(method_name, include_priv = false)
click to toggle source
# File lib/grape/util/lazy/object.rb, line 39 def respond_to_missing?(method_name, include_priv = false) __target_object__.respond_to?(method_name, include_priv) end