Class: Buttons::Javascript::JsVar

Inherits:
Object
  • Object
show all
Defined in:
lib/buttons/javascript/js_var.rb

Direct Known Subclasses

JsArg, JsFunction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ JsVar

Returns a new instance of JsVar.



6
7
8
9
# File 'lib/buttons/javascript/js_var.rb', line 6

def initialize(name)
  @ruby_name = name = name.to_s.gsub(/^\*/, '')
  @name = name.camelcase
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/buttons/javascript/js_var.rb', line 4

def name
  @name
end

#ruby_nameObject (readonly)

Returns the value of attribute ruby_name.



4
5
6
# File 'lib/buttons/javascript/js_var.rb', line 4

def ruby_name
  @ruby_name
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/buttons/javascript/js_var.rb', line 11

def to_s
  @name
end