Class: StructureType

Inherits:
Sunrise::Models::StructureType
  • Object
show all
Defined in:
app/models/defaults/structure_type.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, pageable = true) ⇒ StructureType

Returns a new instance of StructureType.



4
5
6
7
# File 'app/models/defaults/structure_type.rb', line 4

def initialize(code, pageable = true)
  @pageable = pageable
  super code
end

Class Method Details

.pageableObject



14
15
16
# File 'app/models/defaults/structure_type.rb', line 14

def pageable
  all.select(&:pageable?)
end

.pageable_idsObject



18
19
20
# File 'app/models/defaults/structure_type.rb', line 18

def pageable_ids
  pageable.map(&:id)
end

Instance Method Details

#pageable?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/models/defaults/structure_type.rb', line 9

def pageable?
  @pageable
end