Class: Houston::Extensions::FeatureDsl

Inherits:
Object
  • Object
show all
Defined in:
lib/houston/boot/extensions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feature) ⇒ FeatureDsl

Returns a new instance of FeatureDsl.



199
200
201
# File 'lib/houston/boot/extensions.rb', line 199

def initialize(feature)
  @feature = feature
end

Instance Attribute Details

#featureObject (readonly)

Returns the value of attribute feature.



197
198
199
# File 'lib/houston/boot/extensions.rb', line 197

def feature
  @feature
end

Instance Method Details

#ability(&block) ⇒ Object



216
217
218
# File 'lib/houston/boot/extensions.rb', line 216

def ability(&block)
  feature.ability_block = block
end

#field(slug, &block) ⇒ Object



220
221
222
223
224
225
226
# File 'lib/houston/boot/extensions.rb', line 220

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



207
208
209
210
# File 'lib/houston/boot/extensions.rb', line 207

def icon(value)
  Houston.deprecation_notice "The icon option will be removed in Houston 0.9.0"
  feature.icon = value
end

#name(value) ⇒ Object



203
204
205
# File 'lib/houston/boot/extensions.rb', line 203

def name(value)
  feature.name = value
end

#path(&block) ⇒ Object



212
213
214
# File 'lib/houston/boot/extensions.rb', line 212

def path(&block)
  feature.path_block = block
end