Class: Joblin::BackgroundTask::ApiAccess::ApiAccessRules
- Inherits:
-
Object
- Object
- Joblin::BackgroundTask::ApiAccess::ApiAccessRules
- Defined in:
- app/models/joblin/background_task/api_access.rb
Instance Attribute Summary collapse
-
#default_options ⇒ Object
readonly
Returns the value of attribute default_options.
-
#permitted_options ⇒ Object
readonly
Returns the value of attribute permitted_options.
-
#serializer ⇒ Object
Returns the value of attribute serializer.
-
#validators ⇒ Object
readonly
Returns the value of attribute validators.
Instance Method Summary collapse
- #default_option(key, value = nil, &blk) ⇒ Object
-
#initialize ⇒ ApiAccessRules
constructor
A new instance of ApiAccessRules.
- #permit_options(*args) ⇒ Object
- #serialize(&blk) ⇒ Object
- #validate(&blk) ⇒ Object
Constructor Details
#initialize ⇒ ApiAccessRules
Returns a new instance of ApiAccessRules.
135 136 137 138 139 140 |
# File 'app/models/joblin/background_task/api_access.rb', line 135 def initialize @serializer = nil @validators = [] @permitted_options = [] @default_options = {} end |
Instance Attribute Details
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
132 133 134 |
# File 'app/models/joblin/background_task/api_access.rb', line 132 def @default_options end |
#permitted_options ⇒ Object (readonly)
Returns the value of attribute permitted_options.
133 134 135 |
# File 'app/models/joblin/background_task/api_access.rb', line 133 def @permitted_options end |
#serializer ⇒ Object
Returns the value of attribute serializer.
130 131 132 |
# File 'app/models/joblin/background_task/api_access.rb', line 130 def serializer @serializer end |
#validators ⇒ Object (readonly)
Returns the value of attribute validators.
131 132 133 |
# File 'app/models/joblin/background_task/api_access.rb', line 131 def validators @validators end |
Instance Method Details
#default_option(key, value = nil, &blk) ⇒ Object
142 143 144 |
# File 'app/models/joblin/background_task/api_access.rb', line 142 def default_option(key, value = nil, &blk) @default_options[key] = blk || value end |
#permit_options(*args) ⇒ Object
146 147 148 |
# File 'app/models/joblin/background_task/api_access.rb', line 146 def (*args) @permitted_options.concat(args) end |
#serialize(&blk) ⇒ Object
154 155 156 |
# File 'app/models/joblin/background_task/api_access.rb', line 154 def serialize(&blk) @serializer = blk end |
#validate(&blk) ⇒ Object
150 151 152 |
# File 'app/models/joblin/background_task/api_access.rb', line 150 def validate(&blk) @validators << blk end |