Class: Mapper::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman-router/mapper.rb

Overview

A Resource class for a route. Basically just a way to hold data for a route

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Resource

Returns a new instance of Resource.



7
8
9
10
11
12
# File 'lib/middleman-router/mapper.rb', line 7

def initialize(options={})
  @name       = options[:name]
  @route_name = options[:route_name]
  @path       = options[:path]
  @enabled    = options[:enabled]
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



5
6
7
# File 'lib/middleman-router/mapper.rb', line 5

def enabled
  @enabled
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/middleman-router/mapper.rb', line 5

def name
  @name
end

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/middleman-router/mapper.rb', line 5

def path
  @path
end

#route_nameObject

Returns the value of attribute route_name.



5
6
7
# File 'lib/middleman-router/mapper.rb', line 5

def route_name
  @route_name
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/middleman-router/mapper.rb', line 14

def enabled?
  @enabled == true
end