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, id_hash, attributes, instances, db) ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize(id, id_hash, attributes, instances, db) ⇒ App
9 10 11 12 13 14 15 16 17 |
# File 'lib/chapp/app.rb', line 9 def initialize id, id_hash, attributes, instances, db @id = id @id_hash = id_hash @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
19 20 21 22 23 24 25 |
# File 'lib/chapp/app.rb', line 19 def config unless @config @config = @db.app_config @id_hash end @config end |
#connected_apps ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/chapp/app.rb', line 27 def connected_apps unless @connected_apps @connected_apps = Array.new @db.connected_app_ids(id_hash).each do |app_id| @connected_apps << @db.app(app_id) end end @connected_apps end |