Class: Medie::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/medie/link.rb

Overview

a link object

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Link

Returns a new instance of Link.



5
6
7
# File 'lib/medie/link.rb', line 5

def initialize(obj)
  @obj = obj
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args, &block) ⇒ Object



24
25
26
# File 'lib/medie/link.rb', line 24

def method_missing(symbol, *args, &block)
  @obj.send(symbol, *args, &block)
end

Instance Method Details

#content_typeObject



20
21
22
# File 'lib/medie/link.rb', line 20

def content_type
  @obj["type"]
end

#hrefObject



13
14
15
# File 'lib/medie/link.rb', line 13

def href
  @obj["href"]
end

#relObject



17
18
19
# File 'lib/medie/link.rb', line 17

def rel
  @obj["rel"]
end

#to_sObject



28
29
30
# File 'lib/medie/link.rb', line 28

def to_s
  "<link to #{@options}>"
end

#typeObject



9
10
11
# File 'lib/medie/link.rb', line 9

def type
  content_type
end