Class: Micropub::Homesteading::Router

Inherits:
Object
  • Object
show all
Defined in:
lib/micropub/homesteading/router.rb

Constant Summary collapse

H_MAP =
{
  "entry" => "note"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Router

Returns a new instance of Router.



7
8
9
# File 'lib/micropub/homesteading/router.rb', line 7

def initialize(params={})
  @as = params["as"] || h_map(params["h"])
end

Instance Attribute Details

#asObject (readonly)

Returns the value of attribute as.



6
7
8
# File 'lib/micropub/homesteading/router.rb', line 6

def as
  @as
end

Instance Method Details

#h_map(h) ⇒ Object



11
12
13
# File 'lib/micropub/homesteading/router.rb', line 11

def h_map(h)
  H_MAP[h]
end