class Frigate::Function

@example

class Song::AddArtistService < Frigate::Service
        property :song
        property :artist

        def function
                song.artists << artist
        end
end

Song::AddArtistService[song: song, artist: artist]

Public Class Methods

[](attrs)
Alias for: run
new(attrs) click to toggle source

@param [Hash] attrs

# File lib/frigate/function.rb, line 28
def initialize(attrs)
        attrs.each { |key, val| instance_variable_set("@#{key}", val) }
end
property(name) click to toggle source

@param [Symbol] name

# File lib/frigate/function.rb, line 15
def property(name)
        class_eval { attr_reader name }
end
run(attrs) click to toggle source

@param [Hash] attrs

# File lib/frigate/function.rb, line 20
def run(attrs)
        new(attrs).run
end
Also aliased as: []

Public Instance Methods

function() click to toggle source

here you should write your function code =)

# File lib/frigate/function.rb, line 38
def function
        raise NotImplemented
end
run() click to toggle source

to perform/run the service actionstasks

# File lib/frigate/function.rb, line 33
def run
        function
end