Class: Chapp::App
- Inherits:
-
Object
- Object
- Chapp::App
- Defined in:
- lib/chapp/app.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#instances ⇒ Object
readonly
Returns the value of attribute instances.
Instance Method Summary collapse
- #config ⇒ Object
- #connected_apps ⇒ Object
-
#initialize(id, attributes, instances, db) ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize(id, attributes, instances, db) ⇒ App
Returns a new instance of App.
9 10 11 12 13 14 15 16 |
# File 'lib/chapp/app.rb', line 9 def initialize id, attributes, instances, db @id = id @db = db @attributes = attributes @instances = instances @config = nil @connected_apps = nil end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/chapp/app.rb', line 7 def attributes @attributes end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/chapp/app.rb', line 7 def id @id end |
#instances ⇒ Object (readonly)
Returns the value of attribute instances.
7 8 9 |
# File 'lib/chapp/app.rb', line 7 def instances @instances end |
Instance Method Details
#config ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/chapp/app.rb', line 18 def config unless @config @config = @db.app_config @id end @config end |
#connected_apps ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/chapp/app.rb', line 26 def connected_apps unless @connected_apps @connected_apps = Array.new @db.connected_app_ids(@id).each do |app_id| @connected_apps << @db.app(app_id) end end @connected_apps end |