Class: Prigner::Binder
- Inherits:
-
Object
- Object
- Prigner::Binder
- Defined in:
- lib/prigner.rb
Overview
Binder to common filters
When a new Project is created, then several filters are available to use in Skel files.
Instance Attribute Summary collapse
-
#options ⇒ Object
(also: #option)
readonly
Template options.
-
#project ⇒ Object
readonly
Project.
Instance Method Summary collapse
-
#binding ⇒ Object
:nodoc:.
- #date ⇒ Object
-
#enabled?(option) {|block| ... } ⇒ Boolean
Check if an options is enabled in Template.
-
#initialize(project, options) ⇒ Binder
constructor
The binder work binding to Project filters and Template options for use in Skel files.
Constructor Details
#initialize(project, options) ⇒ Binder
The binder work binding to Project filters and Template options for use in Skel files.
187 188 189 |
# File 'lib/prigner.rb', line 187 def initialize(project, ) @project, @options = project, end |
Instance Attribute Details
#options ⇒ Object (readonly) Also known as: option
Template options.
181 182 183 |
# File 'lib/prigner.rb', line 181 def @options end |
#project ⇒ Object (readonly)
Project.
178 179 180 |
# File 'lib/prigner.rb', line 178 def project @project end |
Instance Method Details
#binding ⇒ Object
:nodoc:
200 201 202 |
# File 'lib/prigner.rb', line 200 def binding #:nodoc: super end |
#date ⇒ Object
191 192 193 |
# File 'lib/prigner.rb', line 191 def date Date.today.clone end |
#enabled?(option) {|block| ... } ⇒ Boolean
Check if an options is enabled in Template.
196 197 198 |
# File 'lib/prigner.rb', line 196 def enabled?(option, &block) yield block if @options[option].enabled end |