Class: ForestAdminAgent::Services::SmartActionChecker
- Inherits:
-
Object
- Object
- ForestAdminAgent::Services::SmartActionChecker
- Includes:
- Utils, ForestAdminDatasourceToolkit::Components::Query, ForestAdminDatasourceToolkit::Components::Query::ConditionTree, ForestAdminDatasourceToolkit::Utils
- Defined in:
- lib/forest_admin_agent/services/smart_action_checker.rb
Constant Summary collapse
- MAX_RECORDS_FOR_APPROVAL =
The Forest server's cap on approval record ids; max_records_for_approval may only lower it.
500
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#caller ⇒ Object
readonly
Returns the value of attribute caller.
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#role_id ⇒ Object
readonly
Returns the value of attribute role_id.
-
#smart_action ⇒ Object
readonly
Returns the value of attribute smart_action.
Instance Method Summary collapse
- #can_execute? ⇒ Boolean
-
#initialize(parameters, collection, smart_action, caller, role_id, filter) ⇒ SmartActionChecker
constructor
A new instance of SmartActionChecker.
Constructor Details
#initialize(parameters, collection, smart_action, caller, role_id, filter) ⇒ SmartActionChecker
Returns a new instance of SmartActionChecker.
43 44 45 46 47 48 49 50 51 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 43 def initialize(parameters, collection, smart_action, caller, role_id, filter) @parameters = parameters @collection = collection @smart_action = smart_action @caller = caller @role_id = role_id @filter = filter @attributes = parameters[:data][:attributes] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
41 42 43 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 41 def attributes @attributes end |
#caller ⇒ Object (readonly)
Returns the value of attribute caller.
41 42 43 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 41 def caller @caller end |
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
41 42 43 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 41 def collection @collection end |
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
41 42 43 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 41 def filter @filter end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
41 42 43 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 41 def parameters @parameters end |
#role_id ⇒ Object (readonly)
Returns the value of attribute role_id.
41 42 43 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 41 def role_id @role_id end |
#smart_action ⇒ Object (readonly)
Returns the value of attribute smart_action.
41 42 43 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 41 def smart_action @smart_action end |
Instance Method Details
#can_execute? ⇒ Boolean
53 54 55 56 57 58 59 |
# File 'lib/forest_admin_agent/services/smart_action_checker.rb', line 53 def can_execute? if attributes[:signed_approval_request].nil? can_trigger? else can_approve? end end |