Class: SCB::DB::Level

Inherits:
Object
  • Object
show all
Defined in:
lib/scb/db/level.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, text = nil, api = nil) ⇒ Level

Returns a new instance of Level.



10
11
12
13
14
# File 'lib/scb/db/level.rb', line 10

def initialize(name, text = nil, api = nil)
  @name = name
  @text = text
  @api  = api || SCB.api
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



8
9
10
# File 'lib/scb/db/level.rb', line 8

def api
  @api
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/scb/db/level.rb', line 8

def name
  @name
end

#textObject (readonly)

Returns the value of attribute text.



8
9
10
# File 'lib/scb/db/level.rb', line 8

def text
  @text
end

Instance Method Details

#inspectObject



24
25
26
# File 'lib/scb/db/level.rb', line 24

def inspect
  name
end

#levels(klass = Level) ⇒ Object



16
17
18
# File 'lib/scb/db/level.rb', line 16

def levels(klass = Level)
  @levels ||= objects_for_type(klass, "l")
end

#tables(klass = Table) ⇒ Object



20
21
22
# File 'lib/scb/db/level.rb', line 20

def tables(klass = Table)
  @tables ||= objects_for_type(klass, "t")
end