Class: Representable::Config

Inherits:
Array
  • Object
show all
Defined in:
lib/representable.rb

Overview

NOTE: the API of Config is subject to change so don’t rely too much on this private object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#wrapObject

Returns the value of attribute wrap.



217
218
219
# File 'lib/representable.rb', line 217

def wrap
  @wrap
end

Instance Method Details

#cloneObject



226
227
228
# File 'lib/representable.rb', line 226

def clone
  self.class.new(collect { |d| d.clone })
end

#inherit(parent) ⇒ Object



230
231
232
# File 'lib/representable.rb', line 230

def inherit(parent)
  push(*parent.clone)
end

#wrap_for(name) ⇒ Object

Computes the wrap string or returns false.



220
221
222
223
224
# File 'lib/representable.rb', line 220

def wrap_for(name)
  return unless wrap
  return infer_name_for(name) if wrap === true
  wrap
end