Class: Spree::Core::Partials
- Inherits:
-
Object
- Object
- Spree::Core::Partials
- Defined in:
- lib/spree/core/partials.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
-
#initialize(config, environment) ⇒ Partials
constructor
A new instance of Partials.
- #keys ⇒ Object
- #partial_members ⇒ Object
Constructor Details
#initialize(config, environment) ⇒ Partials
Returns a new instance of Partials.
5 6 7 8 9 |
# File 'lib/spree/core/partials.rb', line 5 def initialize(config, environment) @config = config @environment = environment define_dynamic_methods end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
11 12 13 |
# File 'lib/spree/core/partials.rb', line 11 def config @config end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
11 12 13 |
# File 'lib/spree/core/partials.rb', line 11 def environment @environment end |
Instance Method Details
#keys ⇒ Object
17 18 19 |
# File 'lib/spree/core/partials.rb', line 17 def keys partial_members.map { |member| member.to_s.sub(/_partials$/, '') } end |
#partial_members ⇒ Object
13 14 15 |
# File 'lib/spree/core/partials.rb', line 13 def partial_members environment.members.select { |member| member.to_s.end_with?('_partials') } end |