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.
546 547 548 |
# File 'lib/configuration.rb', line 546 def initialize @feature = ProjectFeature.new end |
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
544 545 546 |
# File 'lib/configuration.rb', line 544 def feature @feature end |
Instance Method Details
#ability(&block) ⇒ Object
562 563 564 |
# File 'lib/configuration.rb', line 562 def ability(&block) feature.ability_block = block end |
#field(slug, &block) ⇒ Object
566 567 568 569 570 571 572 |
# File 'lib/configuration.rb', line 566 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
554 555 556 |
# File 'lib/configuration.rb', line 554 def icon(value) feature.icon = value end |
#name(value) ⇒ Object
550 551 552 |
# File 'lib/configuration.rb', line 550 def name(value) feature.name = value end |
#path(&block) ⇒ Object
558 559 560 |
# File 'lib/configuration.rb', line 558 def path(&block) feature.path_block = block end |