Class: Wire::Function
- Inherits:
-
Object
- Object
- Wire::Function
- Defined in:
- lib/wire.rb
Instance Method Summary collapse
-
#initialize(name, signature = nil, result_type = nil, native_type = nil) ⇒ Function
constructor
A new instance of Function.
-
#service=(service) ⇒ Object
ignore this for any real service call, the http endpoint is evidently incapable of getting this from a header.
- #to_json ⇒ Object
-
#version=(version) ⇒ Object
ignore this for any real service call, the http endpoint is evidently incapable of getting this from a header.
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_json ⇒ Object
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 |