Class: Piglet::Udf::Define

Inherits:
Object
  • Object
show all
Includes:
Inout::StorageTypes
Defined in:
lib/piglet/udf/define.rb

Constant Summary

Constants included from Inout::StorageTypes

Inout::StorageTypes::LOAD_STORE_FUNCTIONS

Instance Method Summary collapse

Methods included from Inout::StorageTypes

#resolve_load_store_function

Constructor Details

#initialize(ali4s, options = nil) ⇒ Define

Returns a new instance of Define.



8
9
10
11
12
13
14
15
16
17
# File 'lib/piglet/udf/define.rb', line 8

def initialize(ali4s, options=nil)
  options ||= {}
  @alias = ali4s
  @command = options[:command]
  @function = options[:function]
  @input = options[:input]
  @output = options[:output]
  @ship = options[:ship]
  @cache = options[:cache]
end

Instance Method Details

#to_sObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/piglet/udf/define.rb', line 19

def to_s
  if @command
    str = "DEFINE #{@alias} `#{@command}`"
    str << io_to_s(:input, @input) if @input
    str << io_to_s(:output, @output) if @output
    str << paths_to_s(:ship, @ship) if @ship
    str << paths_to_s(:cache, @cache) if @cache
    str
  else
    "DEFINE #{@alias} #{@function}"
  end
end