Class: Brite::Part::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/brite/part.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Manager

Returns a new instance of Manager.



63
64
65
66
67
68
69
70
71
# File 'lib/brite/part.rb', line 63

def initialize(model)
  @model = model
  @site  = model.site

  @parts = {}
  model.site.parts.each do |part|
    @parts[part.basename] = part
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



79
80
81
# File 'lib/brite/part.rb', line 79

def method_missing(name, *args, &block)
  @parts[name.to_s].render
end

Instance Method Details

#to_hObject



74
75
76
# File 'lib/brite/part.rb', line 74

def to_h
  @parts
end