Class: Mxrb::RubyApp::Service

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

Overview

Base for generated services. The default body executes through MXRB's pure-Ruby native interpreter and can be replaced with idiomatic Ruby.

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application, context: nil) ⇒ Service

Returns a new instance of Service.



287
288
289
290
# File 'lib/mxrb/ruby_app.rb', line 287

def initialize(application, context: nil)
  @application = application
  @context = context
end

Class Attribute Details

.mendix_idObject (readonly)

Returns the value of attribute mendix_id.



276
277
278
# File 'lib/mxrb/ruby_app.rb', line 276

def mendix_id
  @mendix_id
end

Class Method Details

.mendix_name(value = nil, id: nil) ⇒ Object



278
279
280
281
282
283
284
# File 'lib/mxrb/ruby_app.rb', line 278

def mendix_name(value = nil, id: nil)
  return @mendix_name unless value

  @mendix_name = value.to_s
  @mendix_id = id.to_s
  Registry.register(:service, @mendix_name, self)
end

Instance Method Details

#call(**arguments) ⇒ Object



292
# File 'lib/mxrb/ruby_app.rb', line 292

def call(**arguments) = native_call(arguments)