Class: Datacaster::I18nValues::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/datacaster/i18n_values/base.rb

Direct Known Subclasses

Scope

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



4
5
6
# File 'lib/datacaster/i18n_values/base.rb', line 4

def args
  @args
end

Instance Method Details

#*(other, additional_scope = []) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/datacaster/i18n_values/base.rb', line 6

def *(other, additional_scope = [])
  # To allow redefine array/hash errors with #i18n_key
  other = other.first if other.is_a?(Array) && other.length == 1
  result = apply(other, additional_scope)

  result = [result] unless result.is_a?(Array) || result.is_a?(Hash)
  result
end

#==(other) ⇒ Object



15
16
17
# File 'lib/datacaster/i18n_values/base.rb', line 15

def ==(other)
  self.class == other.class && @args == other.args
end