Class: TubeProxy

Inherits:
Object
  • Object
show all
Defined in:
app/models/tube_proxy.rb

Overview

A tube proxy wraps a tube id and presents it to Rails such that it can be used by url helpers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ TubeProxy

Returns a new instance of TubeProxy.

Parameters:

  • id (Integer)

    The uuid of the tube to redirect to



10
11
12
# File 'app/models/tube_proxy.rb', line 10

def initialize(id)
  @to_param = id
end

Instance Attribute Details

#to_paramObject (readonly)

Returns the value of attribute to_param.



6
7
8
# File 'app/models/tube_proxy.rb', line 6

def to_param
  @to_param
end

Instance Method Details

#model_nameObject



18
19
20
# File 'app/models/tube_proxy.rb', line 18

def model_name
  ::ActiveModel::Name.new(Limber::Tube, false)
end

#persisted?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/models/tube_proxy.rb', line 22

def persisted?
  true
end

#to_modelObject



14
15
16
# File 'app/models/tube_proxy.rb', line 14

def to_model
  self
end