Class: Cuprum::BuiltIn::IdentityCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/cuprum/built_in/identity_command.rb

Overview

A predefined command that returns the value or result it was called with.

Examples:

With a value.

result = IdentityCommand.new.call('custom value')
result.value
#=> 'custom value'
result.success?
#=> true

With a result.

errors = ['errors.messages.unknown']
value  = Cuprum::Result.new('result value', :errors => errors)
result = IdentityCommand.new.call(value)
result.value
#=> 'result value'
result.success?
#=> false
result.errors
#=> ['errors.messages.unknown']

Direct Known Subclasses

IdentityOperation

Method Summary

Methods inherited from Command

#initialize

Methods included from Chaining

#chain, #chain!, #failure, #success, #tap_result, #tap_result!, #yield_result, #yield_result!

Methods included from Processing

#arity, #call

Constructor Details

This class inherits a constructor from Cuprum::Command