Class: JSRailsRoutes::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/js_rails_routes/builder.rb

Defined Under Namespace

Classes: Artifact

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language, route_set_list = RouteSet.correct_matching_route_set_list) ⇒ Builder

Returns a new instance of Builder.

Parameters:



22
23
24
25
# File 'lib/js_rails_routes/builder.rb', line 22

def initialize(language, route_set_list = RouteSet.correct_matching_route_set_list)
  @language = language
  @route_set_list = route_set_list
end

Instance Attribute Details

#languageJSRailsRoutes::Language::Base (readonly)



18
19
20
# File 'lib/js_rails_routes/builder.rb', line 18

def language
  @language
end

#route_set_listArray<JSRailsRoutes::RouteSet> (readonly)

Returns:



15
16
17
# File 'lib/js_rails_routes/builder.rb', line 15

def route_set_list
  @route_set_list
end

Instance Method Details

#buildArray<Artifact>

Returns:



28
29
30
31
32
# File 'lib/js_rails_routes/builder.rb', line 28

def build
  route_set_list.map do |route_set|
    Artifact.new(route_set.name, language.ext, language.handle_route_set(route_set))
  end
end