Class: Qbrick::Partition

Inherits:
Object
  • Object
show all
Defined in:
app/models/qbrick/partition.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, id) ⇒ Partition

Returns a new instance of Partition.



5
6
7
8
# File 'app/models/qbrick/partition.rb', line 5

def initialize(name, id)
  @name = name
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'app/models/qbrick/partition.rb', line 3

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'app/models/qbrick/partition.rb', line 3

def name
  @name
end

Class Method Details

.style_for_index(style, idx) ⇒ Object



10
11
12
13
14
15
16
# File 'app/models/qbrick/partition.rb', line 10

def self.style_for_index(style, idx)
  [
    %w(span8 span4),
    %w(span6 span6),
    %w(span4 span8)
  ][style][idx]
end