Class: LabwareCreators::CreatorButton

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/labware_creators.rb

Overview

Used to render the create plate/tube buttons

Direct Known Subclasses

CustomCreatorButton

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#creatorObject

Returns the value of attribute creator.



32
33
34
# File 'app/models/labware_creators.rb', line 32

def creator
  @creator
end

#filtersObject

Returns the value of attribute filters.



32
33
34
# File 'app/models/labware_creators.rb', line 32

def filters
  @filters
end

#nameObject

Returns the value of attribute name.



32
33
34
# File 'app/models/labware_creators.rb', line 32

def name
  @name
end

#parentObject

Returns the value of attribute parent.



32
33
34
# File 'app/models/labware_creators.rb', line 32

def parent
  @parent
end

#parent_uuidObject

Returns the value of attribute parent_uuid.



32
33
34
# File 'app/models/labware_creators.rb', line 32

def parent_uuid
  @parent_uuid
end

#purpose_uuidObject

Returns the value of attribute purpose_uuid.



32
33
34
# File 'app/models/labware_creators.rb', line 32

def purpose_uuid
  @purpose_uuid
end

#typeObject

Returns the value of attribute type.



32
33
34
# File 'app/models/labware_creators.rb', line 32

def type
  @type
end

Instance Method Details

#custom_form?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'app/models/labware_creators.rb', line 36

def custom_form?
  false
end

#model_nameObject

limber_plate_children (Plate -> Plate) (plate_creation#create) limber_plate_tubes (Plate -> Tube) (tube_creation#create) limber_tube_children (Tube -> Plate) (nothing - want to be plate_creation#create) limber_tube_tubes (Tube -> Tube) (tube_creation#create)



44
45
46
47
48
49
50
51
52
53
54
# File 'app/models/labware_creators.rb', line 44

def model_name
  case type
  # TODO: can we rename 'child' to 'plate' please? see routes.rb
  when 'plate'
    ::ActiveModel::Name.new(Limber::Plate, nil, 'child')
  when 'tube'
    ::ActiveModel::Name.new(Limber::Tube, nil, 'tube')
  else
    raise StandardError, "Unknown type #{type}"
  end
end