Class: Shackleton::Fragment
- Inherits:
-
Object
- Object
- Shackleton::Fragment
- Extended by:
- Forwardable
- Defined in:
- lib/shackleton/fragment.rb
Instance Method Summary collapse
- #arguments ⇒ Object
- #call ⇒ Object
-
#initialize(route, arguments) ⇒ Fragment
constructor
A new instance of Fragment.
- #query_params ⇒ Object
Constructor Details
#initialize(route, arguments) ⇒ Fragment
Returns a new instance of Fragment.
7 8 9 10 |
# File 'lib/shackleton/fragment.rb', line 7 def initialize(route, arguments) @route = route @arguments = arguments end |
Instance Method Details
#arguments ⇒ Object
16 17 18 |
# File 'lib/shackleton/fragment.rb', line 16 def arguments @arguments.slice(*@route.named_fragments) end |
#call ⇒ Object
12 13 14 |
# File 'lib/shackleton/fragment.rb', line 12 def call @route.(arguments) end |
#query_params ⇒ Object
20 21 22 |
# File 'lib/shackleton/fragment.rb', line 20 def query_params @arguments.except(*@route.named_fragments) end |