Sha256: b0ec87174afcde0c08edf7e10fa11bb7f49753bd5461163bac8f17f3b1f4fd63

Contents?: true

Size: 360 Bytes

Versions: 6

Compression:

Stored size: 360 Bytes

Contents

# Add support for type metadata to arrays
class Array

  attr_accessor :member_class, :origin, :origin_attribute

  def to_url_path
    base_path = origin_object.try.to_url_path
    "#{base_path}/#{origin_attribute}" unless base_path.blank?
  end

  def typed_id
    origin and origin_id = origin.try.typed_id and "#{origin_id}:#{origin_attribute}"
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hobo-1.3.0.pre15 lib/hobo/extensions/array.rb
hobo-1.3.0.pre14 lib/hobo/extensions/array.rb
hobo-1.3.0.pre13 lib/hobo/extensions/array.rb
hobo-1.3.0.pre12 lib/hobo/extensions/array.rb
hobo-1.3.0.pre11 lib/hobo/extensions/array.rb
hobo-1.3.0.pre10 lib/hobo/extensions/array.rb