Class: Hashie::Links
- Inherits:
-
Object
- Object
- Hashie::Links
- Defined in:
- lib/desk/deash.rb
Instance Method Summary collapse
-
#initialize(links) ⇒ Links
constructor
A new instance of Links.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(links) ⇒ Links
Returns a new instance of Links.
6 7 8 |
# File 'lib/desk/deash.rb', line 6 def initialize(links) @links = links end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/desk/deash.rb', line 10 def method_missing(method, *args, &block) if @links.key?(method) return nil if !@links[method] return Desk.get(@links[method].href.sub("/api/#{Desk.version}/", "")) end return super end |