Class: Continuum::Module
- Inherits:
-
Object
- Object
- Continuum::Module
- Defined in:
- src/lib/continuum/module.rb
Overview
This class encapsulates all the metadata relevant to an AMP module.
Instance Attribute Summary collapse
-
#id ⇒ Integer
Gets the ID of this module.
-
#location ⇒ String
Gets the location of this module.
-
#name ⇒ String
Gets the name of this module.
Instance Method Summary collapse
-
#get_amp_url ⇒ String?
Gets the URL to this module in AMP.
-
#initialize(module_id, name, location) ⇒ Module
constructor
A new instance of Module.
Constructor Details
#initialize(module_id, name, location) ⇒ Module
Returns a new instance of Module.
26 27 28 29 30 |
# File 'src/lib/continuum/module.rb', line 26 def initialize(module_id, name, location) @id = module_id @name = name @location = location end |
Instance Attribute Details
#id ⇒ Integer
Gets the ID of this module.
11 12 13 |
# File 'src/lib/continuum/module.rb', line 11 def id @id end |
#location ⇒ String
Gets the location of this module.
21 22 23 |
# File 'src/lib/continuum/module.rb', line 21 def location @location end |
#name ⇒ String
Gets the name of this module.
16 17 18 |
# File 'src/lib/continuum/module.rb', line 16 def name @name end |
Instance Method Details
#get_amp_url ⇒ String?
Gets the URL to this module in AMP.
35 36 37 38 |
# File 'src/lib/continuum/module.rb', line 35 def get_amp_url return nil unless @id URI.join(Continuum.configuration.amp_instance_url, "/public/reporting/view_module.php?module_id=#{@id}").to_s end |