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.



167
168
169
# File 'lib/hydra/config.rb', line 167

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

Instance Attribute Details

#groupObject

Returns the value of attribute group.



166
167
168
# File 'lib/hydra/config.rb', line 166

def group
  @group
end

#individualObject

Returns the value of attribute individual.



166
167
168
# File 'lib/hydra/config.rb', line 166

def individual
  @individual
end

Instance Method Details

#[](key) ⇒ Object



174
175
176
177
178
179
180
181
# File 'lib/hydra/config.rb', line 174

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

#merge!(values) ⇒ Object



170
171
172
173
# File 'lib/hydra/config.rb', line 170

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