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.
148 149 150 151 152 153 |
# File 'app/models/joblin/background_task/api_access.rb', line 148 def initialize @serializer = nil @validators = [] @permitted_options = [] @default_options = {} end |
Instance Attribute Details
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
145 146 147 |
# File 'app/models/joblin/background_task/api_access.rb', line 145 def @default_options end |
#permitted_options ⇒ Object (readonly)
Returns the value of attribute permitted_options.
146 147 148 |
# File 'app/models/joblin/background_task/api_access.rb', line 146 def @permitted_options end |
#serializer ⇒ Object
Returns the value of attribute serializer.
143 144 145 |
# File 'app/models/joblin/background_task/api_access.rb', line 143 def serializer @serializer end |
#validators ⇒ Object (readonly)
Returns the value of attribute validators.
144 145 146 |
# File 'app/models/joblin/background_task/api_access.rb', line 144 def validators @validators end |
Instance Method Details
#default_option(key, value = nil, &blk) ⇒ Object
155 156 157 |
# File 'app/models/joblin/background_task/api_access.rb', line 155 def default_option(key, value = nil, &blk) @default_options[key] = blk || value end |
#permit_options(*args) ⇒ Object
159 160 161 |
# File 'app/models/joblin/background_task/api_access.rb', line 159 def (*args) @permitted_options.concat(args) end |
#serialize(&blk) ⇒ Object
167 168 169 |
# File 'app/models/joblin/background_task/api_access.rb', line 167 def serialize(&blk) @serializer = blk end |
#validate(&blk) ⇒ Object
163 164 165 |
# File 'app/models/joblin/background_task/api_access.rb', line 163 def validate(&blk) @validators << blk end |