How to reference a variable to a file within the project
up vote
-1
down vote
favorite
I have a folder called Jsons. Within the folder, there is a file called 'test.json'. At root level, I have a ruby class with a variable called 'hello'.
I want the variable to point to 'test.json' so that I can call that variable when I want the content within test.json.
ruby variables reference
add a comment |
up vote
-1
down vote
favorite
I have a folder called Jsons. Within the folder, there is a file called 'test.json'. At root level, I have a ruby class with a variable called 'hello'.
I want the variable to point to 'test.json' so that I can call that variable when I want the content within test.json.
ruby variables reference
Something likehello = IO.read('jsons/test.json')?
– Stefan
Nov 9 at 17:02
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a folder called Jsons. Within the folder, there is a file called 'test.json'. At root level, I have a ruby class with a variable called 'hello'.
I want the variable to point to 'test.json' so that I can call that variable when I want the content within test.json.
ruby variables reference
I have a folder called Jsons. Within the folder, there is a file called 'test.json'. At root level, I have a ruby class with a variable called 'hello'.
I want the variable to point to 'test.json' so that I can call that variable when I want the content within test.json.
ruby variables reference
ruby variables reference
edited Nov 9 at 16:18
sawa
128k27193297
128k27193297
asked Nov 9 at 16:13
user2879680
43
43
Something likehello = IO.read('jsons/test.json')?
– Stefan
Nov 9 at 17:02
add a comment |
Something likehello = IO.read('jsons/test.json')?
– Stefan
Nov 9 at 17:02
Something like
hello = IO.read('jsons/test.json')?– Stefan
Nov 9 at 17:02
Something like
hello = IO.read('jsons/test.json')?– Stefan
Nov 9 at 17:02
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229415%2fhow-to-reference-a-variable-to-a-file-within-the-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Something like
hello = IO.read('jsons/test.json')?– Stefan
Nov 9 at 17:02