Class: ServiceStack::Function

Inherits:
Object
  • Object
show all
Defined in:
lib/service_stack/function.rb

Constant Summary collapse

Error =
Class.new(StandardError) do
  attr_reader :message, :data

  def initialize(message, data = nil)
    @message = message
    @data = data
  end
end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, options = {}) ⇒ Function

Returns a new instance of Function.



18
19
20
21
# File 'lib/service_stack/function.rb', line 18

def initialize(input, options = {})
  @input = input
  @options = (options.is_a?(Hash) ? options.dup : {}).freeze
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



3
4
5
# File 'lib/service_stack/function.rb', line 3

def input
  @input
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/service_stack/function.rb', line 3

def options
  @options
end

Class Method Details

.perform(input, options = {}) ⇒ Object



14
15
16
# File 'lib/service_stack/function.rb', line 14

def self.perform(input, options = {})
  new(input, options).call
end

Instance Method Details

#callObject



23
24
25
# File 'lib/service_stack/function.rb', line 23

def call
  raise "#call not implemented in #{self.class}"
end