class DSeL::DSL::Nodes::API::Environment

Public Instance Methods

also( *args, &block ) click to toggle source
# File lib/dsel/dsl/nodes/api/environment.rb, line 24
def also( *args, &block )
    # TODO: Store #last_call on Node at the instance level,
    # this global state can be interfered with by other DSLs.
    last_call = DSeL::API::Generator.last_call
    type      = last_call[:type]

    # Check to see if there is a handler that matches our possible object.
    # If so, treat it as object.
    # If not, use the last object and assume arguments.
    if last_call.include?( :object ) &&
        !_dsel_self.class.has_call_handler?( type, args.first )

        args.unshift last_call[:object]
    end

    send( type, *args, &block )

    self
end