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.



127
128
129
# File 'lib/hydra/config.rb', line 127

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

Instance Attribute Details

#groupObject

Returns the value of attribute group.



126
127
128
# File 'lib/hydra/config.rb', line 126

def group
  @group
end

#individualObject

Returns the value of attribute individual.



126
127
128
# File 'lib/hydra/config.rb', line 126

def individual
  @individual
end

Instance Method Details

#[](key) ⇒ Object



134
135
136
137
138
139
140
141
# File 'lib/hydra/config.rb', line 134

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

#merge!(values) ⇒ Object



130
131
132
133
# File 'lib/hydra/config.rb', line 130

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