Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Ruby namespace best practice.

For general discussion related FlowStone

Re: Ruby namespace best practice.

Postby Walter Sommerfeld » Wed May 01, 2013 11:48 am

Hmm,

did i miss something?

when i open ur
Simple Class Door.fsm
i always get the error:

NoMethodError: undefined method 'open?' for
#<Trog::Door:0xa9a74f0 @open=false
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Re: Ruby namespace best practice.

Postby trogluddite » Thu May 02, 2013 9:04 am

Yes, that's right - I was demonstrating why Tronic's 'class method' style call would not work for an instance method - as in the comments...
Code: Select all
# Trog::Door is a class, not a Door!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby namespace best practice.

Postby Walter Sommerfeld » Thu May 02, 2013 11:54 am

I understood... but even now?
Attachments
Class door.jpg
Class door.jpg (28.39 KiB) Viewed 14498 times
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Re: Ruby namespace best practice.

Postby trogluddite » Thu May 02, 2013 8:53 pm

Aaah - now I see!
Didn't read my own API docs! - the correct method is, of course "is_open?" not plain old "open?" - D'oh! :oops:
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby namespace best practice.

Postby Walter Sommerfeld » Fri May 03, 2013 4:05 pm

No prob -

i knew there must be a typo or...

ruby is 2 new 4 me - especially even w/o gems and some standard libs missing!

Even version conflicts/bugs inside ruby and the 'perfecto' :evil: editor in FS makes it more difficult 4 a beginner...

Keep on doing!

P.S: got an access denied error - damn where is that monster coming from (different schematic btw.)
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Re: Ruby namespace best practice.

Postby trogluddite » Fri May 03, 2013 6:28 pm

Walter Sommerfeld wrote:P.S: got an access denied error

What are you tying to access that it won't let you?
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby namespace best practice.

Postby Walter Sommerfeld » Sat May 04, 2013 9:40 am

It was a:
'Dir.mkdir(temp_subfolder_name) unless File.exists?(temp_subfolder_name) # make folder if not exist'


i changed it into this:
if File.directory?(temp_path) #sun mod 20130503
#do nothing
#watch 'temp_path exist', temp_path
else
#watch 'temp_path_dont exists', temp_path
Dir.mkdir(temp_subfolder_name) unless File.exists?(temp_subfolder_name) # make folder if not exist
end
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 41 guests