Class: Contentful::Bootstrap::Templates::Links::Base
- Inherits:
-
Object
- Object
- Contentful::Bootstrap::Templates::Links::Base
- Defined in:
- lib/contentful/bootstrap/templates/links/base.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id) ⇒ Base
constructor
A new instance of Base.
- #link_type ⇒ Object
- #management_class ⇒ Object
- #to_management_object ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(id) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/contentful/bootstrap/templates/links/base.rb', line 9 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/contentful/bootstrap/templates/links/base.rb', line 8 def id @id end |
Instance Method Details
#==(other) ⇒ Object
31 32 33 34 |
# File 'lib/contentful/bootstrap/templates/links/base.rb', line 31 def ==(other) return false unless other.is_a? self.class other.id == id end |
#link_type ⇒ Object
13 14 15 |
# File 'lib/contentful/bootstrap/templates/links/base.rb', line 13 def link_type self.class.name.split('::').last end |
#management_class ⇒ Object
27 28 29 |
# File 'lib/contentful/bootstrap/templates/links/base.rb', line 27 def management_class fail 'must implement' end |
#to_management_object ⇒ Object
21 22 23 24 25 |
# File 'lib/contentful/bootstrap/templates/links/base.rb', line 21 def to_management_object object = management_class.new object.id = id object end |
#type ⇒ Object
17 18 19 |
# File 'lib/contentful/bootstrap/templates/links/base.rb', line 17 def type Contentful::Management::ContentType::LINK end |