class Pakyow::Reflection::Attribute

@api private

Attributes

name[R]
type[R]

Public Class Methods

new(name, type:, required: false) click to toggle source
# File lib/pakyow/reflection/attribute.rb, line 11
def initialize(name, type:, required: false)
  @name, @type, @required = normalize(name), type, required
end

Public Instance Methods

named?(name) click to toggle source
# File lib/pakyow/reflection/attribute.rb, line 15
def named?(name)
  @name == normalize(name)
end
required?() click to toggle source
# File lib/pakyow/reflection/attribute.rb, line 19
def required?
  @required == true
end

Private Instance Methods

normalize(name) click to toggle source
# File lib/pakyow/reflection/attribute.rb, line 25
def normalize(name)
  name.to_s.to_sym
end