Class: Elpong::Scheme
- Inherits:
-
Object
- Object
- Elpong::Scheme
- Defined in:
- lib/elpong/scheme.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ Scheme
constructor
A new instance of Scheme.
- #name ⇒ Object
- #reload ⇒ Object
- #to_json ⇒ Object
Constructor Details
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/elpong/scheme.rb', line 3 def data @data end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/elpong/scheme.rb', line 4 def path @path end |
Instance Method Details
#name ⇒ Object
12 13 14 |
# File 'lib/elpong/scheme.rb', line 12 def name @data['name'] end |
#reload ⇒ Object
16 17 18 19 |
# File 'lib/elpong/scheme.rb', line 16 def reload file = File.read(@path) @data = JSON.parse(file) end |
#to_json ⇒ Object
21 22 23 |
# File 'lib/elpong/scheme.rb', line 21 def to_json JSON.generate(@data) end |