Class: Shirinji::Bean
- Inherits:
-
Object
- Object
- Shirinji::Bean
- Defined in:
- lib/shirinji/bean.rb
Instance Attribute Summary collapse
-
#access ⇒ Object
readonly
Returns the value of attribute access.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#construct ⇒ Object
readonly
Returns the value of attribute construct.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#attr(name, ref: nil, value: nil) ⇒ Object
rubocop:enable Metrics/ParameterLists.
-
#initialize(name, class_name: nil, value: nil, access:, construct: true, &block) ⇒ Bean
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(name, class_name: nil, value: nil, access:, construct: true, &block) ⇒ Bean
rubocop:disable Metrics/ParameterLists
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/shirinji/bean.rb', line 8 def initialize( name, class_name: nil, value: nil, access:, construct: true, &block ) check_params!(class_name, value) @name = name @class_name = class_name @value = value @access = access @attributes = {} @construct = construct instance_eval(&block) if block end |
Instance Attribute Details
#access ⇒ Object (readonly)
Returns the value of attribute access.
5 6 7 |
# File 'lib/shirinji/bean.rb', line 5 def access @access end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/shirinji/bean.rb', line 5 def attributes @attributes end |
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
5 6 7 |
# File 'lib/shirinji/bean.rb', line 5 def class_name @class_name end |
#construct ⇒ Object (readonly)
Returns the value of attribute construct.
5 6 7 |
# File 'lib/shirinji/bean.rb', line 5 def construct @construct end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/shirinji/bean.rb', line 5 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/shirinji/bean.rb', line 5 def value @value end |