Class: Trello::Schema::AttributeBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/trello/schema/attribute_builder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options) ⇒ AttributeBuilder

Returns a new instance of AttributeBuilder.



12
13
14
15
# File 'lib/trello/schema/attribute_builder.rb', line 12

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/trello/schema/attribute_builder.rb', line 10

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/trello/schema/attribute_builder.rb', line 10

def options
  @options
end

Class Method Details

.build(name, options = {}) ⇒ Object



5
6
7
# File 'lib/trello/schema/attribute_builder.rb', line 5

def build(name, options = {})
  new(name, options).build
end

Instance Method Details

#buildObject



17
18
19
20
21
22
23
# File 'lib/trello/schema/attribute_builder.rb', line 17

def build
  attribute_class.new(
    name: name,
    options: options,
    serializer: serializer
  )
end