Class: TubeProxy
- Inherits:
-
Object
- Object
- TubeProxy
- 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
-
#to_param ⇒ Object
readonly
Returns the value of attribute to_param.
Instance Method Summary collapse
-
#initialize(id) ⇒ TubeProxy
constructor
A new instance of TubeProxy.
- #model_name ⇒ Object
- #persisted? ⇒ Boolean
- #to_model ⇒ Object
Constructor Details
#initialize(id) ⇒ TubeProxy
Returns a new instance of TubeProxy.
10 11 12 |
# File 'app/models/tube_proxy.rb', line 10 def initialize(id) @to_param = id end |
Instance Attribute Details
#to_param ⇒ Object (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_name ⇒ Object
18 19 20 |
# File 'app/models/tube_proxy.rb', line 18 def model_name ::ActiveModel::Name.new(Limber::Tube, false) end |
#persisted? ⇒ Boolean
22 23 24 |
# File 'app/models/tube_proxy.rb', line 22 def persisted? true end |
#to_model ⇒ Object
14 15 16 |
# File 'app/models/tube_proxy.rb', line 14 def to_model self end |