Class: Mxrb::Dsl::NavigationBuilder
- Inherits:
-
Object
- Object
- Mxrb::Dsl::NavigationBuilder
- Defined in:
- lib/mxrb/dsl/builder.rb
Instance Method Summary collapse
-
#initialize ⇒ NavigationBuilder
constructor
A new instance of NavigationBuilder.
- #profile(name, home_page: nil, home_microflow: nil, sign_in_page: nil, menu: nil, role_homes: {}, offline: false, kind: nil, app_title: nil, app_icon: nil, &block) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ NavigationBuilder
Returns a new instance of NavigationBuilder.
445 446 447 |
# File 'lib/mxrb/dsl/builder.rb', line 445 def initialize @profiles = [] end |
Instance Method Details
#profile(name, home_page: nil, home_microflow: nil, sign_in_page: nil, menu: nil, role_homes: {}, offline: false, kind: nil, app_title: nil, app_icon: nil, &block) ⇒ Object
449 450 451 452 453 454 455 456 457 458 |
# File 'lib/mxrb/dsl/builder.rb', line 449 def profile(name, home_page: nil, home_microflow: nil, sign_in_page: nil, menu: nil, role_homes: {}, offline: false, kind: nil, app_title: nil, app_icon: nil, &block) profile = NavigationProfileBuilder.new( name, home_page:, home_microflow:, sign_in_page:, menu:, role_homes:, offline:, kind:, app_title:, app_icon: ) profile.instance_eval(&block) if block @profiles << profile.to_h end |
#to_h ⇒ Object
460 461 462 |
# File 'lib/mxrb/dsl/builder.rb', line 460 def to_h { profiles: @profiles } end |