Class: Cubicle::Expansion

Inherits:
Member
  • Object
show all
Defined in:
lib/cubicle/expansion.rb

Instance Attribute Summary collapse

Attributes inherited from Member

#alias_list, #condition, #expression, #expression_type, #field_name, #name, #options

Instance Method Summary collapse

Methods inherited from Member

#included_in?, #matches, #to_js_keys, #to_js_value

Constructor Details

#initialize(*args) ⇒ Expansion

Returns a new instance of Expansion.



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/cubicle/expansion.rb', line 4

def initialize(*args)
  super

  @value_variable = self.options[:value] ||
                    self.options[:value_variable] ||
                    "#{self.name.to_s.singularize}_value"

  @index_variable = self.options[:index] ||
                    self.options[:index_variable] ||
                    self.options[:key] ||
                    self.options[:key_variable] ||
                    "#{self.name.to_s.singularize}_key"
end

Instance Attribute Details

#index_variableObject (readonly)

Returns the value of attribute index_variable.



3
4
5
# File 'lib/cubicle/expansion.rb', line 3

def index_variable
  @index_variable
end

#value_variableObject (readonly)

Returns the value of attribute value_variable.



3
4
5
# File 'lib/cubicle/expansion.rb', line 3

def value_variable
  @value_variable
end