Class: MrMurano::EventHandler::EventHandlerItem
- Inherits:
-
Item
- Object
- Item
- MrMurano::EventHandler::EventHandlerItem
- Defined in:
- lib/MrMurano/Solution-Services.rb
Overview
EventHandler Specific details on an Item
Instance Attribute Summary collapse
-
#alias ⇒ String
Already part of Item: :id :name :updated_at.
-
#created_at ⇒ String
Timestamp when this was created.
-
#event ⇒ String
Which event triggers this script.
-
#phantom ⇒ Boolean
True if a “phantom”, a script that exists on the server but is just the empty string.
-
#script_key ⇒ Object
(lb): 2018-08-09: This has been missing until now, when the recently added warning in Item’s []= started complaining about it.
-
#service ⇒ String
Which service triggers this script.
-
#solution_id ⇒ String
The soln’s product.id or application.id (Murano’s api_id).
-
#svc_alias ⇒ String
Service alias, e.g., “productproduct.id”.
-
#type ⇒ String
For device2 events, the type of event.
-
#undeletable ⇒ Boolean
True if a service that should not be deleted remotely.
Instance Method Summary collapse
Instance Attribute Details
#alias ⇒ String
Already part of Item:
:id
:name
:updated_at
469 470 471 |
# File 'lib/MrMurano/Solution-Services.rb', line 469 def alias @alias end |
#created_at ⇒ String
Returns Timestamp when this was created.
479 480 481 |
# File 'lib/MrMurano/Solution-Services.rb', line 479 def created_at @created_at end |
#event ⇒ String
Returns Which event triggers this script.
485 486 487 |
# File 'lib/MrMurano/Solution-Services.rb', line 485 def event @event end |
#phantom ⇒ Boolean
Returns True if a “phantom”, a script that exists on the server but is just the empty string. You cannot delete these services from the platform without breaking stuff, but we can at least let the user delete these files locally. See: eventhandler.undeletable.
495 496 497 |
# File 'lib/MrMurano/Solution-Services.rb', line 495 def phantom @phantom end |
#script_key ⇒ Object
(lb): 2018-08-09: This has been missing until now, when the
recently added warning in Item's []= started complaining
about it.
(lb): FIXME/2018-08-09: Do we need to leverage this attribute
at all? For now we're just consuming it from the platform,
but we not using it (though we use script_key elsewhere in
the code).
477 478 479 |
# File 'lib/MrMurano/Solution-Services.rb', line 477 def script_key @script_key end |
#service ⇒ String
Returns Which service triggers this script.
483 484 485 |
# File 'lib/MrMurano/Solution-Services.rb', line 483 def service @service end |
#solution_id ⇒ String
Returns The soln’s product.id or application.id (Murano’s api_id).
481 482 483 |
# File 'lib/MrMurano/Solution-Services.rb', line 481 def solution_id @solution_id end |
#svc_alias ⇒ String
Returns Service alias, e.g., “MrMurano::EventHandler::EventHandlerItem.productproduct.id”.
489 490 491 |
# File 'lib/MrMurano/Solution-Services.rb', line 489 def svc_alias @svc_alias end |
#type ⇒ String
Returns For device2 events, the type of event.
487 488 489 |
# File 'lib/MrMurano/Solution-Services.rb', line 487 def type @type end |
#undeletable ⇒ Boolean
Returns True if a service that should not be deleted remotely.
497 498 499 |
# File 'lib/MrMurano/Solution-Services.rb', line 497 def undeletable @undeletable end |
Instance Method Details
#reject_ephemeral ⇒ Object
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/MrMurano/Solution-Services.rb', line 499 def reject_ephemeral super.reject do |attr_key, attr_val| [ # Writeable platform properties: # :alias, # :event, # :service, # :solution_id, # :type, # Read-only platform properties: :created_at, # Local-only attrs: :phantom, :svc_alias, :undeletable, ].include?(attr_key) || ((attr_key == :type) && (attr_val.nil?)) end end |