Class: Refinery::Flare::Template

Inherits:
Object
  • Object
show all
Includes:
HashInitializer
Defined in:
app/models/refinery/flare/template.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HashInitializer

#initialize

Instance Attribute Details

#refinery_optionsObject

Returns the value of attribute refinery_options.



7
8
9
# File 'app/models/refinery/flare/template.rb', line 7

def refinery_options
  @refinery_options
end

#repeatableObject

Returns the value of attribute repeatable.



7
8
9
# File 'app/models/refinery/flare/template.rb', line 7

def repeatable
  @repeatable
end

Class Method Details

.allObject



27
28
29
# File 'app/models/refinery/flare/template.rb', line 27

def all
  @@all
end

.define_template(attributes) ⇒ Object



20
21
22
23
24
25
# File 'app/models/refinery/flare/template.rb', line 20

def define_template(attributes)
  template = Template.new(attributes)

  @@all ||= []
  @@all << template
end

Instance Method Details

#refinery_options_exist?Boolean

Returns:

  • (Boolean)


13
14
15
16
17
# File 'app/models/refinery/flare/template.rb', line 13

def refinery_options_exist?
  unless refinery_options.keys - Refinery::Page.attribute_names.map { |a| a.to_sym } == []
    errors.add(:refinery_options, "Invalid refinery_options for #{self.class}")
  end
end