Class: PicturePath::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/picturepath/account.rb

Overview

PicturePath account information

Constant Summary collapse

@@ESCAPE =
"escape_"

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_id, *arguments) ⇒ Object

Escape properties starting with escape_ using CGI.escape



11
12
13
14
15
16
17
# File 'lib/picturepath/account.rb', line 11

def method_missing(method_id, *arguments) 
  method_name = method_id.to_s
  if method_name[0..@@ESCAPE.length-1] == @@ESCAPE
    method = method_name[@@ESCAPE.length..method_name.length].to_sym
    return CGI.escape(send(method))
  end
end

Instance Attribute Details

#action_urlObject

Returns the value of attribute action_url.



8
9
10
# File 'lib/picturepath/account.rb', line 8

def action_url
  @action_url
end

#passwordObject

Returns the value of attribute password.



8
9
10
# File 'lib/picturepath/account.rb', line 8

def password
  @password
end

#usernameObject

Returns the value of attribute username.



8
9
10
# File 'lib/picturepath/account.rb', line 8

def username
  @username
end