Class: Wes::Cloudkit::Routing
- Inherits:
-
Object
- Object
- Wes::Cloudkit::Routing
- Defined in:
- lib/wes/cloudkit/routing.rb
Instance Attribute Summary collapse
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
Instance Method Summary collapse
-
#initialize(routes) ⇒ Routing
constructor
A new instance of Routing.
- #require_all ⇒ Object
Constructor Details
#initialize(routes) ⇒ Routing
Returns a new instance of Routing.
9 10 11 12 13 14 15 |
# File 'lib/wes/cloudkit/routing.rb', line 9 def initialize(routes) @routes = routes.map do |h| OpenStruct.new(h).tap do |os| os.klass = "#{namespace}::#{class_name os.file}" end end end |
Instance Attribute Details
#routes ⇒ Object (readonly)
Returns the value of attribute routes.
7 8 9 |
# File 'lib/wes/cloudkit/routing.rb', line 7 def routes @routes end |
Instance Method Details
#require_all ⇒ Object
17 18 19 |
# File 'lib/wes/cloudkit/routing.rb', line 17 def require_all @routes.each { |r| require_class r.file } end |