Class: Houston::ProjectFeatureDsl
- Inherits:
-
Object
- Object
- Houston::ProjectFeatureDsl
- Defined in:
- lib/configuration.rb
Instance Attribute Summary collapse
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
Instance Method Summary collapse
- #ability(&block) ⇒ Object
- #field(slug, &block) ⇒ Object
- #icon(value) ⇒ Object
-
#initialize ⇒ ProjectFeatureDsl
constructor
A new instance of ProjectFeatureDsl.
- #name(value) ⇒ Object
- #path(&block) ⇒ Object
Constructor Details
#initialize ⇒ ProjectFeatureDsl
Returns a new instance of ProjectFeatureDsl.
545 546 547 |
# File 'lib/configuration.rb', line 545 def initialize @feature = ProjectFeature.new end |
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
543 544 545 |
# File 'lib/configuration.rb', line 543 def feature @feature end |
Instance Method Details
#ability(&block) ⇒ Object
561 562 563 |
# File 'lib/configuration.rb', line 561 def ability(&block) feature.ability_block = block end |
#field(slug, &block) ⇒ Object
565 566 567 568 569 570 571 |
# File 'lib/configuration.rb', line 565 def field(slug, &block) dsl = FormBuilderDsl.new dsl.instance_eval(&block) form = dsl.form form.slug = slug feature.fields.push form end |
#icon(value) ⇒ Object
553 554 555 |
# File 'lib/configuration.rb', line 553 def icon(value) feature.icon = value end |
#name(value) ⇒ Object
549 550 551 |
# File 'lib/configuration.rb', line 549 def name(value) feature.name = value end |
#path(&block) ⇒ Object
557 558 559 |
# File 'lib/configuration.rb', line 557 def path(&block) feature.path_block = block end |