Class: Debci::ExtraAptSource

Inherits:
Object
  • Object
show all
Defined in:
lib/debci/extra_apt_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry, allowed_users = [], signing_key = nil) ⇒ ExtraAptSource

Returns a new instance of ExtraAptSource.



5
6
7
8
9
# File 'lib/debci/extra_apt_source.rb', line 5

def initialize(entry, allowed_users = [], signing_key = nil)
  @entry = entry
  @allowed_users = allowed_users || []
  @signing_key = signing_key
end

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



3
4
5
# File 'lib/debci/extra_apt_source.rb', line 3

def entry
  @entry
end

#signing_keyObject (readonly)

Returns the value of attribute signing_key.



3
4
5
# File 'lib/debci/extra_apt_source.rb', line 3

def signing_key
  @signing_key
end

Instance Method Details

#allowed?(user) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/debci/extra_apt_source.rb', line 11

def allowed?(user)
  @allowed_users.include?(user.id) || @allowed_users.empty?
end