Class: Moura::Model::Local
- Inherits:
-
Object
- Object
- Moura::Model::Local
- Defined in:
- lib/moura/model/local.rb
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(file) ⇒ Local
constructor
A new instance of Local.
Constructor Details
#initialize(file) ⇒ Local
Returns a new instance of Local.
8 9 10 11 12 13 14 15 |
# File 'lib/moura/model/local.rb', line 8 def initialize(file) @roles = YAML.load_file(file, aliases: true).sort_by(&:first).to_h do |(k, v)| apps = v["apps"] || [] users = v["users"] || [] [k, { "apps" => apps.sort.uniq, "users" => users.sort.uniq }] end end |
Instance Method Details
#dump ⇒ Object
17 18 19 |
# File 'lib/moura/model/local.rb', line 17 def dump @roles end |