Class: FormatFeature

Inherits:
Object
  • Object
show all
Defined in:
lib/petro/format_feature.rb

Defined Under Namespace

Classes: Feature

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FormatFeature

Returns a new instance of FormatFeature.



5
6
7
# File 'lib/petro/format_feature.rb', line 5

def initialize(options)
  @features = build_features(options)
end

Instance Attribute Details

#featuresObject (readonly)

Returns the value of attribute features.



3
4
5
# File 'lib/petro/format_feature.rb', line 3

def features
  @features
end

Instance Method Details

#build_features(options) ⇒ Object

What do you want??

* All I care about is the code to generate controllers
  and models.

* A feature is both a controller and model, if they both
  exist.


19
20
21
22
23
# File 'lib/petro/format_feature.rb', line 19

def build_features(options)
  options['features'].map do |f|
    Feature.new(f['name'], f)
  end
end