Class: Lanes::Screens::Definition

Inherits:
Object
  • Object
show all
Includes:
Concerns::AttrAccessorWithDefault
Defined in:
lib/lanes/screens.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sprockets) ⇒ Definition

Returns a new instance of Definition.



59
60
61
# File 'lib/lanes/screens.rb', line 59

def initialize(sprockets)
    @sprockets=sprockets
end

Class Method Details

.each(config) ⇒ Object



55
56
57
# File 'lib/lanes/screens.rb', line 55

def self.each(config)
    self.descendants.each{ |klass| yield klass.new(config) }
end

Instance Method Details

#to_jsonObject



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/lanes/screens.rb', line 63

def to_json
    Oj.dump({
        id:    identifier,
        title: title,
        icon:  icon,
        model: model_class,
        view:  view_class,
        files: files.map{ |f| "#{Lanes.config.assets_path_prefix}/#{f}"},
        group_id: group_id,
        description: description
    }, mode: :compat)
end