Class: LocalLibrary::Library

Inherits:
Object
  • Object
show all
Defined in:
lib/local_library/library.rb

Constant Summary collapse

@@libraries =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(branch) ⇒ Library

Returns a new instance of Library.



7
8
9
# File 'lib/local_library/library.rb', line 7

def initialize(branch)
  @branch = branch
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



2
3
4
# File 'lib/local_library/library.rb', line 2

def address
  @address
end

#branchObject (readonly)

Returns the value of attribute branch.



3
4
5
# File 'lib/local_library/library.rb', line 3

def branch
  @branch
end

#phoneObject

Returns the value of attribute phone.



2
3
4
# File 'lib/local_library/library.rb', line 2

def phone
  @phone
end

#statusObject

Returns the value of attribute status.



2
3
4
# File 'lib/local_library/library.rb', line 2

def status
  @status
end

Class Method Details

.array_lengthObject



15
16
17
# File 'lib/local_library/library.rb', line 15

def self.array_length
  self.libraries.length
end

.clearObject



19
20
21
# File 'lib/local_library/library.rb', line 19

def self.clear
  self.libraries.clear
end

.librariesObject



11
12
13
# File 'lib/local_library/library.rb', line 11

def self.libraries
  @@libraries
end