Class: Ecm::Cms::Importers::Navigation
- Inherits:
-
Object
- Object
- Ecm::Cms::Importers::Navigation
- Defined in:
- lib/ecm/cms/importers/navigation.rb
Instance Attribute Summary collapse
-
#yaml ⇒ Object
readonly
Returns the value of attribute yaml.
Instance Method Summary collapse
- #build_navigations ⇒ Object
-
#initialize(yaml, _option = {}) ⇒ Navigation
constructor
A new instance of Navigation.
- #navigations ⇒ Object
Constructor Details
#initialize(yaml, _option = {}) ⇒ Navigation
Returns a new instance of Navigation.
5 6 7 8 |
# File 'lib/ecm/cms/importers/navigation.rb', line 5 def initialize(yaml, _option = {}) @navigations = nil @yaml = YAML.load(yaml) end |
Instance Attribute Details
#yaml ⇒ Object (readonly)
Returns the value of attribute yaml.
23 24 25 |
# File 'lib/ecm/cms/importers/navigation.rb', line 23 def yaml @yaml end |
Instance Method Details
#build_navigations ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/ecm/cms/importers/navigation.rb', line 10 def = [] @yaml.each do || = Ecm::Cms::Navigation.new() << end if @yaml.respond_to?(:each) end |
#navigations ⇒ Object
19 20 21 |
# File 'lib/ecm/cms/importers/navigation.rb', line 19 def @navigations ||= end |