require 'rest-graph/auto_load'

7 views
Skip to first unread message

simone

unread,
Aug 25, 2010, 12:11:39 PM8/25/10
to rest-graph
Hi,
I'm new with your gem. The command in object seems to not work. I've a
file named rest-graph.yaml in the configuration folder.
Here is the file:

development: &default
app_id: xxxxxxxxxxxxxxxxx
secret: xxxxxxxxxxxxxxxxxxxxxx
canvas: http://127.0.0.1:3001/

production:
*default

test:
*default

Here what I get once executed the command RestGraph.new in the
development consolle:

RestGraph.new
=> #<struct RestGraph auto_decode=nil, graph_server=nil,
old_server=nil, accept=nil, lang=nil, app_id=nil, secret=nil,
data=nil, cache=nil, error_handler=nil, log_handler=nil>

Nothing! Could you please help me out ?

Thanks
Simone

Lin Jen-Shin (aka godfat 真常)

unread,
Aug 25, 2010, 4:12:13 PM8/25/10
to rest-...@googlegroups.com
Hi,

On Thu, Aug 26, 2010 at 12:11 AM, simone <simone...@gmail.com> wrote:
> RestGraph.new
> => #<struct RestGraph auto_decode=nil, graph_server=nil,
> old_server=nil, accept=nil, lang=nil, app_id=nil, secret=nil,
> data=nil, cache=nil, error_handler=nil, log_handler=nil>
>
> Nothing! Could you please help me out ?
>
> Thanks
> Simone

I agreed this is confusing, but actually setup in config
means default values, and default values means if
there's no value inside an instance of RestGraph,
the default one would be returned. In this case, try:

# => should return the app_id in the YAML file.
>> RestGraph.new.app_id

Though when you inspect it, it looks like there's no value at all,
but that's where default values come into play.

Do you have any suggestion for this? Thanks a lot!

cheers,

Lin Jen-Shin (aka godfat 真常)

unread,
Sep 1, 2010, 5:57:45 AM9/1/10
to rest-...@googlegroups.com
Hi, just pushed a change that you may now see default values in irb
(i.e. inspect)

http://github.com/cardinalblue/rest-graph/commit/8c0118d17168b6c36161c1d73a0f10a10788703c

Reply all
Reply to author
Forward
0 new messages