Class: Synapse::Easy::ExtraSection

Inherits:
Object
  • Object
show all
Includes:
Fake::Hash
Defined in:
lib/synapse/easy/extra_section.rb

Direct Known Subclasses

FrontendSection, StatsSection

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ExtraSection

Returns a new instance of ExtraSection.



10
11
12
13
14
15
# File 'lib/synapse/easy/extra_section.rb', line 10

def initialize params={}
  @name      = params[:name]
  @type      = params[:type]
  @type    ||= "frontend"
  @options ||= []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/synapse/easy/extra_section.rb', line 9

def name
  @name
end

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/synapse/easy/extra_section.rb', line 9

def options
  @options
end

#typeObject

Returns the value of attribute type.



9
10
11
# File 'lib/synapse/easy/extra_section.rb', line 9

def type
  @type
end

Instance Method Details

#each(*args, &block) ⇒ Object



22
23
24
# File 'lib/synapse/easy/extra_section.rb', line 22

def each *args, &block
  section_options.each(*args,&block)
end

#labelObject



16
17
18
# File 'lib/synapse/easy/extra_section.rb', line 16

def label
  "#{type} #{name}"
end

#section_optionsObject



19
20
21
# File 'lib/synapse/easy/extra_section.rb', line 19

def section_options
  options
end

#to_synapseObject



25
26
27
28
29
# File 'lib/synapse/easy/extra_section.rb', line 25

def to_synapse
  {
    label => section_options
  }
end