Class: Prigner::Binder

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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, options)
  @project, @options = project, options
end

Instance Attribute Details

#optionsObject (readonly) Also known as: option

Template options.



181
182
183
# File 'lib/prigner.rb', line 181

def options
  @options
end

#projectObject (readonly)

Project.



178
179
180
# File 'lib/prigner.rb', line 178

def project
  @project
end

Instance Method Details

#bindingObject

:nodoc:



200
201
202
# File 'lib/prigner.rb', line 200

def binding #:nodoc:
  super
end

#dateObject



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.

Yields:

  • (block)

Returns:

  • (Boolean)


196
197
198
# File 'lib/prigner.rb', line 196

def enabled?(option, &block)
  yield block if @options[option].enabled
end