Class: Swappy::Config
- Inherits:
-
Object
- Object
- Swappy::Config
- Defined in:
- lib/swappy/config.rb
Instance Attribute Summary collapse
-
#json_data ⇒ Object
readonly
Returns the value of attribute json_data.
-
#link_root ⇒ Object
readonly
Returns the value of attribute link_root.
-
#source_root ⇒ Object
readonly
Returns the value of attribute source_root.
Instance Method Summary collapse
-
#initialize(json_data, link_root, source_root) ⇒ Config
constructor
A new instance of Config.
- #link_file ⇒ Object
- #link_path ⇒ Object
- #source_file ⇒ Object
- #source_path ⇒ Object
Constructor Details
#initialize(json_data, link_root, source_root) ⇒ Config
Returns a new instance of Config.
5 6 7 8 9 |
# File 'lib/swappy/config.rb', line 5 def initialize(json_data, link_root, source_root) @link_root = link_root @source_root = source_root @json_data = json_data end |
Instance Attribute Details
#json_data ⇒ Object (readonly)
Returns the value of attribute json_data.
3 4 5 |
# File 'lib/swappy/config.rb', line 3 def json_data @json_data end |
#link_root ⇒ Object (readonly)
Returns the value of attribute link_root.
3 4 5 |
# File 'lib/swappy/config.rb', line 3 def link_root @link_root end |
#source_root ⇒ Object (readonly)
Returns the value of attribute source_root.
3 4 5 |
# File 'lib/swappy/config.rb', line 3 def source_root @source_root end |
Instance Method Details
#link_file ⇒ Object
11 12 13 |
# File 'lib/swappy/config.rb', line 11 def link_file json_data[0] end |
#link_path ⇒ Object
19 20 21 |
# File 'lib/swappy/config.rb', line 19 def link_path File.(File.join(link_root, link_file)) end |
#source_file ⇒ Object
15 16 17 |
# File 'lib/swappy/config.rb', line 15 def source_file json_data[1] end |
#source_path ⇒ Object
23 24 25 |
# File 'lib/swappy/config.rb', line 23 def source_path File.(File.join(source_root, source_file)) end |