Class: Brainstem::Concerns::PresenterDSL::BaseBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/brainstem/dsl/base_block.rb

Direct Known Subclasses

AssociationsBlock, ConditionalsBlock, FieldsBlock

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, block_options = {}, &block) ⇒ BaseBlock

Returns a new instance of BaseBlock.



7
8
9
10
11
# File 'lib/brainstem/dsl/base_block.rb', line 7

def initialize(configuration, block_options = {}, &block)
  @configuration = configuration
  @block_options = block_options
  block.arity < 1 ? self.instance_eval(&block) : block.call(self) if block_given?
end

Instance Attribute Details

#block_optionsObject

Returns the value of attribute block_options.



5
6
7
# File 'lib/brainstem/dsl/base_block.rb', line 5

def block_options
  @block_options
end

#configurationObject

Returns the value of attribute configuration.



5
6
7
# File 'lib/brainstem/dsl/base_block.rb', line 5

def configuration
  @configuration
end

Instance Method Details

#with_options(new_options = {}, &block) ⇒ Object



13
14
15
# File 'lib/brainstem/dsl/base_block.rb', line 13

def with_options(new_options = {}, &block)
  descend self.class, configuration, new_options, &block
end