Class: Backline::Model::Attributes::Attribute

Inherits:
Struct
  • Object
show all
Defined in:
lib/backline/model/attributes/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Attribute

Returns a new instance of Attribute.



6
7
8
# File 'lib/backline/model/attributes/attribute.rb', line 6

def initialize(name, options = {})
  super(name.to_s, options)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/backline/model/attributes/attribute.rb', line 4

def name
  @name
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



4
5
6
# File 'lib/backline/model/attributes/attribute.rb', line 4

def options
  @options
end

Instance Method Details

#getter_methodObject



10
11
12
# File 'lib/backline/model/attributes/attribute.rb', line 10

def getter_method
  name
end

#setter_methodObject



14
15
16
# File 'lib/backline/model/attributes/attribute.rb', line 14

def setter_method
  "#{name}="
end