Class: Wire::Function

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

Instance Method Summary collapse

Constructor Details

#initialize(name, signature = nil, result_type = nil, native_type = nil) ⇒ Function

Returns a new instance of Function.



10
11
12
13
14
15
# File 'lib/wire.rb', line 10

def initialize(name, signature = nil, result_type = nil, native_type = nil)
  @name = name
  @signature = signature
  @result_type = result_type
  @native_type = native_type
end

Instance Method Details

#service=(service) ⇒ Object

ignore this for any real service call, the http endpoint is evidently incapable of getting this from a header



18
19
20
# File 'lib/wire.rb', line 18

def service= (service)
  @service=service
end

#to_jsonObject



27
28
29
# File 'lib/wire.rb', line 27

def to_json
  "{'endpoint': '#{@name}'" + ((@signature == nil) ? '' : ", 'signature': #{@signature}") + ((@result_type == nil) ? '' : ", 'resultType': '#{@result_type}'") + ((@native_type == nil) ? '' : ", 'nativeType': '#{@native_type}'") + ((@service == nil) ? '' : ", 'service': '#{@service}'") + ((@version == nil) ? '' : ", 'version': '#{@version}'") + '}'
end

#version=(version) ⇒ Object

ignore this for any real service call, the http endpoint is evidently incapable of getting this from a header



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

def version= (version)
  @version=version
end