Class: Hydra::Config::PermissionsConfig::GroupPermission

Inherits:
Object
  • Object
show all
Defined in:
lib/hydra/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values = {}) ⇒ GroupPermission

Returns a new instance of GroupPermission.



176
177
178
# File 'lib/hydra/config.rb', line 176

def initialize(values = {})
  merge! values
end

Instance Attribute Details

#groupObject

Returns the value of attribute group.



175
176
177
# File 'lib/hydra/config.rb', line 175

def group
  @group
end

#individualObject

Returns the value of attribute individual.



175
176
177
# File 'lib/hydra/config.rb', line 175

def individual
  @individual
end

Instance Method Details

#[](key) ⇒ Object



183
184
185
186
187
188
189
190
# File 'lib/hydra/config.rb', line 183

def [] key
  case key
    when :group, :individual
      send key
    else
      raise "Unknown key"
  end
end

#merge!(values) ⇒ Object



179
180
181
182
# File 'lib/hydra/config.rb', line 179

def merge! values
  @group = values[:group]
  @individual = values[:individual]
end