Class: Hashrocket::Wireframe

Inherits:
Struct
  • Object
show all
Defined in:
app/models/hashrocket/wireframe.rb

Defined Under Namespace

Modules: Excludes, Filter

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



2
3
4
# File 'app/models/hashrocket/wireframe.rb', line 2

def filename
  @filename
end

Class Method Details

.allObject



9
10
11
# File 'app/models/hashrocket/wireframe.rb', line 9

def self.all
  files.sort.map(&instantize).extend(Filter)
end

.cleanedObject



17
18
19
# File 'app/models/hashrocket/wireframe.rb', line 17

def self.cleaned
  all.filter(excludes)
end

.filesObject



5
6
7
# File 'app/models/hashrocket/wireframe.rb', line 5

def self.files
  Dir.glob('app/views/ui/*.html.haml')
end

.instantize(*args) ⇒ Object



13
14
15
# File 'app/models/hashrocket/wireframe.rb', line 13

def self.instantize(*args)
  method(:new)
end

Instance Method Details

#nameObject



21
22
23
# File 'app/models/hashrocket/wireframe.rb', line 21

def name
  File.basename(filename,'.html.haml')
end

#path(controller_name = 'ui') ⇒ Object



25
26
27
# File 'app/models/hashrocket/wireframe.rb', line 25

def path(controller_name='ui')
  ['/', controller_name, '/', name].join
end