Class: Perpetuity::Postgres::ValueWithAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/perpetuity/postgres/value_with_attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, attribute) ⇒ ValueWithAttribute

Returns a new instance of ValueWithAttribute.



5
6
7
8
# File 'lib/perpetuity/postgres/value_with_attribute.rb', line 5

def initialize value, attribute
  @value = value
  @attribute = attribute
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object



18
19
20
# File 'lib/perpetuity/postgres/value_with_attribute.rb', line 18

def method_missing *args, &block
  value.send(*args, &block)
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



4
5
6
# File 'lib/perpetuity/postgres/value_with_attribute.rb', line 4

def attribute
  @attribute
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/perpetuity/postgres/value_with_attribute.rb', line 4

def value
  @value
end

Instance Method Details

#embedded?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/perpetuity/postgres/value_with_attribute.rb', line 14

def embedded?
  attribute.embedded?
end

#typeObject



10
11
12
# File 'lib/perpetuity/postgres/value_with_attribute.rb', line 10

def type
  attribute.type
end